Change data with SQL
query_rwUse this when the user wants to keep data so they (or another agent) can query it again later: save a result or uploaded rows as a table, add rows over time, correct or remove rows. Change data: run ONE DuckDB statement that writes (INSERT, UPDATE, DELETE, MERGE INTO, CREATE TABLE, CREATE SCHEMA, ALTER TABLE, DROP TABLE, DROP SCHEMA) on the server, over tables named catalog.namespace.table; the catalog after INSERT INTO, UPDATE, DELETE FROM, MERGE INTO or TABLE/SCHEMA is the one written, every other is only read. It also changes a table's columns (ALTER TABLE). It needs write on the catalog (the person approves it when connecting, or the API key holds it); a catalog you can only read is refused. Every committed write is a new snapshot of the table (older versions stay readable); a DROP removes a table with its history and cannot be undone, so confirm it with the person first. No CREATE OR REPLACE: DROP, then CREATE. Reads belong in query. A 409 commit_conflict (another writer committed first), a 408 write_timeout or a 502 write_outcome_unknown: read the table (query) before sending the statement again, since the write may be in it. Large loads belong in the user's own DuckDB (lhbox duckdb) or lhbox table import.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | one DuckDB statement that writes, tables named catalog.namespace.table |