Skip to content

Views

A View is a “virtual table” whose contents are defined by a query. Unlike a standard table, a view does not store data itself; instead, it saves a SQL query that runs dynamically whenever you access the view.

Views are powerful tools for simplifying complex data retrieval, aggregating data for reports, or formatting data specifically for frontend consumption without altering the underlying database structure.

To create a new view:

  1. In the Data Model sidebar, locate the + Add Table button.
  2. Click the dropdown arrow next to it.
  3. Select Add View.

View creation interface

  1. Write Query: Enter standard SQL SELECT statements to define which columns and rows should appear in the view.
    • Example: SELECT first_name, email FROM students WHERE is_active = true;
  2. Run/Test: Use the Play button (▶) to execute the query and preview the results immediately in the console. This ensures your syntax is correct before saving.

View configuration panel

  1. Write Name: The unique system identifier for the view. This name will be exposed in your API just like a standard table (e.g., activeStudents).
  2. Write Description: An optional text area to document the purpose of the complex query for your team.
  3. Click Save

View result preview

If you need to modify the structure or underlying query of an existing view, you can access its configuration directly from the sidebar menu.

  1. Navigate to the Views section in the left-hand Data Model sidebar.
  2. Locate the specific view you wish to modify (e.g., view_student).
  3. Click Edit (the pencil icon) to open the settings and update the view’s query or parameters.

View schema definition

(Note: From this same context menu, you also have the option to permanently Delete the view by clicking the red trash can icon).

  • Data Security: Create a view that exposes only public fields (like names) while hiding sensitive ones (like personal IDs or phone numbers) from specific API consumers.
  • Simplification: Pre-join multiple related tables (e.g., Students + Courses + Grades) into a single virtual table so the frontend can query it easily without complex logic.
  • Reporting: Use SQL aggregation functions (like COUNT, AVG, SUM) to create a view that shows live statistics (e.g., “Monthly Sales Total”) automatically.