SQL reference
DROP
Every DROP form the engine accepts — tables, indexes, views, materialized views, transformations, sources, credentials, access and users.
Each object kind has its own DROP form. Use the form that matches the object.
| Statement | IF EXISTS | Removes |
|---|---|---|
DROP TABLE <name> | yes | A table and its data. |
DROP INDEX <index> ON <table> | yes | One secondary index. |
DROP VIEW <name> | yes | A logical view. |
DROP MATERIALIZED VIEW <name> | yes | A materialized view or template and its engine-owned rows. |
DROP MATERIALIZATION <name> | yes | One instance of a materialized view template. |
DROP TRANSFORMATION <name> | yes | A transformation; its target table stays. |
DROP SOURCE <name> | no | A federated source and its external relations. |
DROP CREDENTIAL <uuid> | no | A stored federation credential. |
DROP APPLICATION ACCESS <name> | no | An application access. |
DROP USER <name> | no | Disables a user. |
DROP API KEY <label> FOR USER <name> | no | Disables an API key. |
With IF EXISTS, a missing object is a successful no-op. Each statement drops one object.
Tables
DROP TABLE transfers;Views and definitions that read a table are dropped before the table.
DROP TABLE IF EXISTS transfers;Indexes
DROP INDEX transfers_ts ON transfers;DROP INDEX IF EXISTS transfers_ts ON transfers;The table name is part of the statement: an index is named within its table.
Views
DROP VIEW token_volume;DROP VIEW IF EXISTS token_volume;The IF EXISTS form on a missing view answers success with "applied":false.
Materialized views and materializations
Materializations of a template are dropped before the template.
DROP MATERIALIZATION balances_chain_1;DROP MATERIALIZED VIEW balances_by_chain;After the drop, reading the name answers HTTP 404.
Transformations
DROP TRANSFORMATION balance_activity;DROP TRANSFORMATION IF EXISTS balance_activity;Dropping a transformation stops the writer. The target table keeps its rows.
Federation objects
Federation statements run on a WebSocket session. See Federation for the statements that create these objects.
DROP SOURCE ledgerDROP CREDENTIAL 6f1c2d3e-4a5b-4c6d-8e9f-0a1b2c3d4e5fA credential belongs to the tenant that imported it. After it is dropped, its credential file is removed.
DROP APPLICATION ACCESS analytics_readerDropping an application access removes its authentication policy.
Users and API keys
DROP USER and DROP API KEY disable the credential; the sessions that depend on it end on
their next operation. See Users and API keys.
DROP USER analystDROP API KEY reporting FOR USER analystAfter DROP API KEY, the key's secret no longer signs in.
ALTER TABLE
The schema changes ALTER TABLE makes — columns, attribute groups, defaults, nullability, names and types — and how running readers follow them.
INSERT, UPSERT and REPLACE
Write one row per statement with INSERT, UPSERT or REPLACE, optionally into one attribute group, and how literals map to column types.