DuckDB (in-memory RDB)
Analytic SQL engine with optional file-backed catalog. Project InMemoryDB/DuckDBDataSourceCore/. Class DuckDBDataSource (namespace DuckDBDataSourceCore) inherits InMemoryRDBSource, which inherits RDBSource from DataSourcesPlugins/RDBMSDataSource — so CRUD, schema, Dapper, and transactions follow the same shared RDBMS plugin path as SQL Server or PostgreSQL, with IInMemoryDB structure/load behavior on top. AddinAttribute: category INMEMORY, type DuckDB.
Inheritance & shared plugin
Chain: DuckDBDataSource → InMemoryRDBSource → RDBSource (partial classes under RDBMSDataSource/PartialClasses/RDBSource/). Dialect-specific SQL still flows through IDataSourceHelper for DataSourceType.DuckDB where BeepDM registers templates.
For the full list of engines on RDBSource and how helpers fit in, read RDBMS family overview.
Registration
DataSourceType:DuckDB- Category:
INMEMORY
NuGet (see csproj)
DuckDB.NET.Bindings.Full, DuckDB.NET.Data.Full, plus Beep packages in DuckDBDataSourceCore.csproj.
Delimiters & connection wiring
The constructor sets ColumnDelimiter = "[]" and ParameterDelimiter = "$" (DuckDB-style). It uses RDBDataConnection from the shared plugin and binds ConnectionProperties from the editor by connection name, with DatabaseType = DataSourceType.DuckDB.
File readers
The project registers DuckDB-backed readers for several file types (for example Parquet, JSON, TSV). Registration helpers live in FileReaders/DuckDbFileReaderRegistration.cs (RegisterNonConflicting, RegisterAllPrimaryFormats). NDJSON/JSONL uses DataSourceType.FlatFile so it does not replace the default JSON reader—see in-repo comments on DuckDbNdjsonFileReader.
Extended commands (DuckDbExtendedFunctions)
Discoverable UI functions are defined on a partial DuckDBDataSource in InMemoryDB/DuckDBDataSourceCore/DuckDbExtendedFunctions.cs. Each method uses [CommandAttribute(..., DatasourceType = DataSourceType.DuckDB, ClassType = "DuckDbExtendedFunctions")] so the editor can list them alongside standard IDataSource operations. The table below is the full set as of the current source (36 commands).
Name (attribute) | C# method | Return |
|---|---|---|
| CreateSequence | CreateSequence(sequenceName, start, increment, minValue, maxValue, cycle) | void |
| CreateOrReplaceView | CreateOrReplaceView(viewName, viewQuerySql) | void |
| ImportFromMultipleCsvFiles | ImportFromMultipleCsvFiles(tableName, filePattern, union_by_name) | void — read_csv_auto glob |
| ImportFromMultipleParquetFiles | ImportFromMultipleParquetFiles(tableName, filePattern) | void — parquet_scan |
| ImportCSV | ImportCSV(filePath, tableName, createTable) | void — COPY or CREATE AS read_csv_auto |
| ExportToCSV | ExportToCSV(tableName, filePath) | void |
| ImportParquetIntoExistingTable | ImportParquetIntoExistingTable(filePath, tableName) | void |
| ImportParquet | ImportParquet(filePath, tableName) | void — CREATE TABLE AS read_parquet |
| ImportJson | ImportJson(filePath, tableName, parameters) | void |
| ExportJson | ExportJson(filePath, tableName) | void — see source SQL |
| ImportJsonIntoExistingTable | ImportJsonIntoExistingTable(filePath, tableName) | void |
| ExportToParquet | ExportToParquet(tableName, filePath) | void |
| ExportQueryResultToParquet | ExportQueryResultToParquet(query, filePath) | void |
| ExecuteParameterizedQuery | ExecuteParameterizedQuery(sql, parameters) | DataTable |
| ExportToPartitionedParquet | ExportToPartitionedParquet(tableName, directoryPath, partitionColumn) | void |
| ExportQueryToPartitionedParquet | ExportQueryToPartitionedParquet(query, directoryPath, partitionColumns) | void |
| ExecuteNonQuery | ExecuteNonQuery(sql) | int |
| GetScalarValue | GetScalarValue(sql) | object |
| TableExists | TableExists(tableName) | bool |
| DropTable | DropTable(tableName) | void |
| PrintQueryResults | PrintQueryResults(queryResult) | void — console; DuckDBResult |
| ParquetMetaData | ParquetMetaData(filePath) | DataTable — parquet_metadata |
| ReadTextFile | ReadTextFile(filePath) | DataTable — read_text |
| ReadParquetFile | ReadParquetFile(filepath, binaryAsString, filename, fileRowNumber, hivePartitioning, unionByName) | DataTable |
| ReadMultipleCSVFiles | ReadMultipleCSVFiles(filePaths, union_by_name, filename) | DataTable |
| JSONLoad | JSONLoad(filepath, …many options…) | DataTable — json_read |
| CSVLoad | CSVLoad(filepath, …many options…) | DataTable — read_csv_auto |
| InstallExtension | InstallExtension(extensionName) | void — INSTALL |
| LoadExtension | LoadExtension(extensionName) | void — LOAD |
| AttachDatabase | AttachDatabase(dbPath, alias, type) | void — ATTACH |
| DetachDatabase | DetachDatabase(alias) | void |
| ExportDatabase | ExportDatabase(directoryPath) | void — EXPORT DATABASE |
| ImportDatabase | ImportDatabase(directoryPath) | void — IMPORT DATABASE |
| SniffCSV | SniffCSV(filepath) | DataTable — sniff_csv |
| SummarizeTable | SummarizeTable(tableName) | DataTable — SUMMARIZE |
| SetMemoryLimit | SetMemoryLimit(limit) | void — PRAGMA memory_limit |
Caption and ObjectType (from CommandAttribute)
Same commands as above, in Order sequence as declared in DuckDbExtendedFunctions.cs (for UI grouping / discovery).
Order | Name | Caption | ObjectType |
|---|---|---|---|
| 1 | CreateSequence | Create Sequence | Sequence |
| 2 | CreateOrReplaceView | Create Or Replace View | View |
| 3 | ImportFromMultipleCsvFiles | Import Multiple CSVs | Table |
| 4 | ImportFromMultipleParquetFiles | Import Multiple Parquets | Table |
| 5 | ImportCSV | Import CSV | Table |
| 6 | ExportToCSV | Export To CSV | File |
| 7 | ImportParquetIntoExistingTable | Import Parquet To Table | Table |
| 8 | ImportParquet | Import Parquet | Table |
| 9 | ImportJson | Import JSON | Table |
| 10 | ExportJson | Export JSON | Table |
| 11 | ImportJsonIntoExistingTable | Import JSON To Table | Table |
| 12 | ExportToParquet | Export To Parquet | Table |
| 13 | ExportQueryResultToParquet | Export Query To Parquet | Query |
| 14 | ExecuteParameterizedQuery | Execute Parameterized Query | Query |
| 15 | ExportToPartitionedParquet | Export To Partitioned Parquet | Table |
| 16 | ExportQueryToPartitionedParquet | Export Query To Partitioned Parquet | Query |
| 17 | ExecuteNonQuery | Execute Non Query | Query |
| 18 | GetScalarValue | Get Scalar Value | Query |
| 19 | TableExists | Table Exists | Table |
| 20 | DropTable | Drop Table | Table |
| 21 | PrintQueryResults | Print Query Results | Query |
| 22 | ParquetMetaData | Parquet Meta Data | Table |
| 23 | ReadTextFile | Read Text File | Table |
| 24 | ReadParquetFile | Read Parquet File | Table |
| 25 | ReadMultipleCSVFiles | Read Multiple CSV Files | Table |
| 26 | JSONLoad | JSON Load | Table |
| 27 | CSVLoad | CSV Load | Table |
| 28 | InstallExtension | Install Extension | Extension |
| 29 | LoadExtension | Load Extension | Extension |
| 30 | AttachDatabase | Attach Database | Database |
| 31 | DetachDatabase | Detach Database | Database |
| 32 | ExportDatabase | Export Database | Database |
| 33 | ImportDatabase | Import Database | Database |
| 34 | SniffCSV | Sniff CSV | Table |
| 35 | SummarizeTable | Summarize Table | Table |
| 36 | SetMemoryLimit | Set Memory Limit | Memory |
Parameter names and defaults match the C# signatures in DuckDbExtendedFunctions.cs. For full argument lists (especially JSONLoad and CSVLoad), use the source file. Standard entity CRUD and metadata still come from RDBSource / IDataSource.
In-memory workflow
Follow IInMemoryDB patterns from BeepDM/.cursor/inmemorydb: open store, load/create structure, then load or sync data. Validate ConnectionStatus before heavy ETL.
Also read
RDBSource/ RDBMS plugin family (inheritance and helpers)- Local & in-memory overview
- SQLite (sibling
InMemoryRDBSource+ILocalDB) BeepDM/.cursor/inmemorydb/SKILL.md