SQL dialect & statements
The PostgreSQL-like dialect and analytics extras, batch vs single statements, parameters, and
transactions.
Type system
Every DuckDB type as a
DuckValue, NULL and validity, the lossless TypeInfo, and
feature-dependent read types.Extensions
Bundled at build time (
json / parquet / icu) vs loaded at runtime (spatial and more).Error handling
How failures surface, DuckDB’s typed
EngineError, and the panic = "abort" caveat.The one-page tour
- Dialect. DuckDB’s SQL is PostgreSQL-like with analytics extras —
QUALIFY,GROUP BY ALL,SELECT * EXCLUDE (...),COLUMNS(...), list/struct/map literals,UNNEST,PIVOT, and friendly casting (x::t,TRY_CAST). Full tour on SQL dialect. - Statements.
execute_batchruns many;-separated statements (DuckDB does the parsing); a singleexecuteprepares and runs one.SELECT/RETURNINGyield rows, DML reports achanges()count, DDL changes nothing. - Parameters. Positional (
$1,?) viaexecute_with, named ($name) viaexecute_with_named. See parameters. - Types. Values arrive as
DuckValue, covering every integer width,DECIMAL,UUID,BIT,BIGNUM, temporals, and the compositeLIST/ARRAY/STRUCT/MAP/UNION/ENUM. The read type for temporals/decimals/UUID depends on feature flags. - NULL. First-class —
DuckValue::Null, a per-column validity bitmask in columnar access, andOption<T>round-tripping. - Extensions. Either bundled at build time (no runtime install) or loaded at runtime via the extension API.
- Transactions. Driven as SQL (
BEGIN/COMMIT/ROLLBACK) — no savepoints. See transactions.
Two engine behaviors worth memorizing
DuckDB version
better-duck pins a specific vendored DuckDB inbetter-duck-sys;
better_duck_core::library_version() returns the linked version
string at runtime (e.g. "v1.5.5"). See
Versioning & compatibility.
Related
Queries, Results & Values
The
DuckValue type, parameter binding, and result metadata in depth.Appender
Bulk ingest and the data-chunk path.