Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,14 @@ jobs:
run: cargo clippy --all-targets --all-features --no-deps -- -D warnings

- name: Run tests
# `write-sqlite` pulls in the writer and sqlite-provider tests,
# which are `#![cfg]`-gated; without it cargo compiles them to
# zero-test binaries.
run: |
if [[ "$RUNNER_OS" == "macOS" ]]; then
cargo test --features skip-tests-with-docker
cargo test --features "skip-tests-with-docker write-sqlite"
else
cargo test
cargo test --features "write-sqlite"
fi

- name: Check documentation
Expand Down
10 changes: 10 additions & 0 deletions src/metadata_writer_sqlite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,16 @@ CREATE TABLE IF NOT EXISTS ducklake_column (
column_type VARCHAR NOT NULL,
column_order INTEGER NOT NULL,
nulls_allowed BOOLEAN DEFAULT 1,
-- Mirror the upstream DuckLake spec (ducklake_metadata_manager.cpp):
-- `parent_column` is projected by our reader's SQL_GET_TABLE_COLUMNS;
-- the four `*default*` columns are projected by DuckDB when it reads
-- catalogs we produce. We leave them NULL — no nested-type or
-- column-default writes yet.
initial_default VARCHAR,
default_value VARCHAR,
parent_column INTEGER,
default_value_type VARCHAR,
default_value_dialect VARCHAR,
begin_snapshot INTEGER NOT NULL,
end_snapshot INTEGER
);
Expand Down
9 changes: 9 additions & 0 deletions tests/sqlite_metadata_provider_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ async fn init_schema(pool: &SqlitePool) -> anyhow::Result<()> {
.execute(pool)
.await?;

// Schema must match SQL_CREATE_SCHEMA in metadata_writer_sqlite.rs.
sqlx::query(
"CREATE TABLE IF NOT EXISTS ducklake_column (
column_id INTEGER PRIMARY KEY,
Expand All @@ -76,6 +77,11 @@ async fn init_schema(pool: &SqlitePool) -> anyhow::Result<()> {
column_type TEXT NOT NULL,
column_order INTEGER NOT NULL,
nulls_allowed INTEGER,
initial_default TEXT,
default_value TEXT,
parent_column INTEGER,
default_value_type TEXT,
default_value_dialect TEXT,
begin_snapshot INTEGER NOT NULL DEFAULT 1,
end_snapshot INTEGER,
FOREIGN KEY (table_id) REFERENCES ducklake_table(table_id)
Expand All @@ -93,6 +99,9 @@ async fn init_schema(pool: &SqlitePool) -> anyhow::Result<()> {
file_size_bytes INTEGER NOT NULL,
footer_size INTEGER,
encryption_key TEXT,
record_count INTEGER,
row_id_start INTEGER,
mapping_id INTEGER,
begin_snapshot INTEGER NOT NULL DEFAULT 1,
end_snapshot INTEGER,
FOREIGN KEY (table_id) REFERENCES ducklake_table(table_id)
Expand Down
Loading