CREATE / REFRESH / DROP VIEW
CREATE VIEW persists a compiled SQL relation from a relational FeatureQL body. REFRESH VIEW recompiles the stored body. DROP VIEW removes the view feature.
Conceptual workflow: Persisted views . Integration overview: SQL interoperability .
CREATE VIEW
CREATE [OR REPLACE] VIEW FMV.schema.table AS query
The name is exactly three identifiers and must start with FMV. (UE/VIEW-NAME-NOT-THREE-LEVEL, UE/VIEW-NAME-NOT-FMV).
The body is one relational FeatureQL query. It may name FM. features, KEYSETs, and physical tables. It must not name another view (UE/VIEW-NOT-A-FEATUREQL-SOURCE).
Create, replace, and refresh compile DuckDB, Trino, and serving atomically. Compiler warnings fail the statement unless the body contains the matching ACK-XXXX comment. Acknowledgments never suppress errors.
CREATE VIEW on an existing view, or CREATE OR REPLACE VIEW over a non-view at the same name, is UE/VIEW-ALREADY-EXISTS.
REFRESH VIEW
REFRESH VIEW FMV.schema.table
Recompiles the stored authored body. Does not materialize rows. The stored ACK-XXXX comment still applies. Failed refresh leaves the prior artifacts.
DROP VIEW
DROP VIEW [IF EXISTS] FMV.schema.table
IF EXISTS is silent when the name is absent. Dropping a view that SQL still names is UE/VIEW-NOT-FOUND at scan time.
DESCRIBE fields
FUNCTION is "VIEW". View-only DESCRIBE (FIELDS (…)) names:
| Field | Meaning |
|---|---|
VIEW_COLUMNS | Published output names, authored RETURN order |
VIEW_HIDDEN_COLUMNS | Compiled dependencies that are not published columns |
VIEW_NESTED_BINDS | Nested / RELATED binding inputs frozen into the snapshot |
VIEW_BIND_PARAMS | Frozen KEYSET / bind parameters (uppercase FeatureQL identifiers) |
VIEW_BACKENDS | duckdb, trino, serving |
VIEW_ACKNOWLEDGED_WARNINGS | ACK-XXXX tokens taken from the stored body |
See DESCRIBE .