Files
turso/docs/sql-reference/statements
Glauber Costa 2c16e2a2e8 Add DEFAULT keyword support in INSERT VALUES expressions
Implement the SQL-standard (SQL:2016 §14.11) DEFAULT keyword inside
INSERT VALUES lists, allowing explicit use of column defaults on a
per-value basis:

  INSERT INTO t (a, b) VALUES (1, DEFAULT), (DEFAULT, 2);

This feature does not exist in SQLite — it is a Turso extension as
part of our effort to make Turso behave more like Postgres, which has
supported this syntax for a long time. The motivation is that omitting
columns from the INSERT column list applies defaults uniformly across
all rows, but DEFAULT in VALUES lets different rows use defaults for
different columns within the same statement.

Expr::Default is resolved to the actual column default expression (or
NULL) in the AST before bytecode compilation, so both single-row and
multi-row INSERT paths work without special-casing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-19 20:26:18 -05:00
..