Search Shortcut cmd + k | ctrl + k
- Documentation
- Specification
- Introduction
- Data Types
- Queries
- Tables
- DuckDB Extension
- Introduction
- Usage
- Connecting
- Choosing a Catalog Database
- Choosing Storage
- Snapshots
- Schema Evolution
- Time Travel
- Configuration
- Paths
- Maintenance
- Advanced Features
- Constraints
- Conflict Resolution
- Data Change Feed
- Data Inlining
- Encryption
- Partitioning
- Transactions
- Row Lineage
- Views
- Comments
- Metadata
- FAQ
Documentation
/ DuckDB Extension
/ Advanced Features
Constraints
DuckLake has limited support for constraints.
The only constraint type that is currently supported is NOT NULL
.
It does not support PRIMARY KEY
, FOREIGN KEY
, UNIQUE
or CHECK
constraints.
Examples
Define a column as not accepting NULL
values using the NOT NULL
constraint.
CREATE TABLE tbl (col INTEGER NOT NULL);
Add a NOT NULL
constraint to an existing column of an existing table.
ALTER TABLE tbl ALTER col SET NOT NULL;
Drop a NOT NULL
constraint from a table.
ALTER TABLE tbl ALTER col DROP NOT NULL;