Handler for SQL CREATE MATERIALIZED VIEW statements
Materialized Views
Handler for SQL CREATE MATERIALIZED VIEW statements
POST /apps/:app_id/views/sql
Body: { "sql": "CREATE MATERIALIZED VIEW app::view AS SELECT ... FROM app::collection WHERE ..." }
Headers: X-App-Key (required with Admin permission)
The SQL must use the "app::collection" format for table references.
This handler translates the SQL to JSON and calls the existing create_materialized_view handler.
POST
Handler for SQL CREATE MATERIALIZED VIEW statements
Path Parameters
Application ID
Body
application/json
SQL CREATE MATERIALIZED VIEW Request
SQL CREATE MATERIALIZED VIEW statement Format: CREATE MATERIALIZED VIEW app::view_name AS SELECT ... FROM app::collection WHERE ... GROUP BY ... Example: "CREATE MATERIALIZED VIEW myapp::daily_summary AS SELECT market, SUM(volume) as total FROM myapp::trades GROUP BY market"
Optional refresh mode: "live" (auto-refresh on write) or "lazy" (manual refresh) Defaults to "lazy"
Response
View created successfully