Repository navigation
Proposal: add optional DuckLake helpers without changing the core provider #362
Replies: 3 comments
|
Clarification on the packaging question: “separate package” means a separate GitHub repository, not merely another project in this repository. My current recommendation is: keep the proposed thin adapter in this repository as a separate project and publish it as a separate NuGet package. It is tightly coupled to A separate repository would become the better home if this grows into an independent .NET DuckLake SDK, supports multiple .NET DuckDB providers, develops catalog/credential/storage/migration abstractions beyond SQL attachment, needs an independent release cadence, or is taken on by the DuckLake project/community itself. The PR decision should explicitly resolve same-repository separate project versus separate repository before implementation is submitted. |
|
@Giorgi thanks for turning it into a discussion. Happy to contribute the code but would be good to hear from other folks if this is something they'd be interested in. |
|
@luisquintanilla Sounds good. To be honest, I haven't used DuckLake myself, so hearing from people who do would help. Let's leave this open for feedback, and if there's interest we can figure out the best home for it. Out of curiosity, are you using it at Microsoft, or is this from a personal project? |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Summary
DuckDB.NET already executes ordinary DuckLake SQL through
DuckDB.NET.Data: callers canLOAD ducklake,ATTACH 'ducklake:...',USEthe catalog, and then use normal commands, parameters, transactions, readers, schema APIs, Arrow, and appenders. This proposal is for a small optional convenience package rather than a DuckLake implementation inside the ADO.NET provider.Proposed public API
Package:
DuckDB.NET.DuckLakeTarget frameworks:
net8.0andnet10.0Dependency:
DuckDB.NET.Dataonly. The package contains no DuckLake extension and no native DuckDB binaries.Attach options
Catalogis the complete DuckLake URI, for exampleducklake:metadata.ducklake; accepting the complete URI keeps local, SQLite, PostgreSQL, and other DuckLake catalog forms possible without adding catalog-specific fields to the provider.Connection helpers
Example
For an already open connection, the equivalent is:
UseAfterAttachdefaults totrue, so the helper also executesUSE "lake". Set it tofalsewhen callers want to address the attached catalog explicitly, such asSELECT * FROM lake.events.SQL generated by the helper
For the example options, the helper emits the equivalent of:
Identifiers and string literals are quoted by the helper because DuckDB cannot parameterize the catalog URI, alias, or
DATA_PATHinATTACH. The helper rejects null characters, requires the catalog URI to start withducklake:, rejects blank aliases, and rejects specifying bothSnapshotVersionandSnapshotTime. Snapshot timestamps are rendered as invariant UTC values.Behavioral and security contract
LOAD ducklake; it never executesINSTALL, enables external access, enables autoinstall, or creates secrets.AttachDuckLakeandLoadDuckLakeExtensionrequire an openDuckDBConnection.OpenDuckLakeopens and returns a normalDuckDBConnection; if loading or attaching fails, it disposes the connection before rethrowing.ATTACHandUSEare connection-session state. Reopening a connection requires loading/attaching the lake again.DuckDBConnectionStringBuilder, reinterpretData Source, or make DuckLake state global.ReadOnly, snapshot selection, and automatic migration are passed through to DuckLake’sATTACHoptions.SnapshotVersionandSnapshotTimeare mutually exclusive.Proposed scope
Add the optional managed-only package with the API above, plus:
The core
DuckDB.NET.Dataconnection-string builder and native bindings would remain unchanged. DuckLake catalog backends, storage, credentials, and extension provisioning remain deployment concerns.Compatibility evidence
The current DuckDB.NET native baseline is DuckDB v1.5.6. A compatibility harness and real-extension tests verified
INSTALL/LOAD, repeatedLOAD,DATA_PATH,SNAPSHOT_VERSION,SNAPSHOT_TIME,READ_ONLY,AUTOMATIC_MIGRATION,USE, ordinary SQL, transactions, schema inspection, Arrow reads, reconnect/read-only behavior, and appender persistence. Appender behavior should be treated as DuckDB/DuckLake-version coupled rather than as a permanent provider guarantee; SQL or a native temporary table followed byINSERT INTO ... SELECT ...remains the portable fallback.Questions for maintainers
DuckDB.NET.DuckLakehelper package useful and appropriate in this repository, or should support remain documentation-only / live in a separate package?UseAfterAttach, andOpenDuckLakefactory?INSTALL ducklakein an explicitly enabled test path, or should CI use a separately provisioned extension directory/artifact?Non-goals
DuckDBConnectionStringBuilderor changing the meaning ofData Source.If this direction is accepted, I can follow up with a focused PR targeting
develop, including the helper package, tests, CI, and documentation.All reactions