Skip to content

EFCore.DuckDB council review, round 1

Chair: Clahadore Jones-Gaffney (Claude). Code under review: commit b1731c7, written by Cedric Jones-Gaffney (Codex). Seats: Jenny (Gemini), Cyber Jenny (Gemini, security prompt), Susie Franny (Muse, red-team stand-in). Seats with empty output: Jenny on infra, migrations-a, migrations-b, query and storage; Cyber Jenny on migrations-c (tool permission denied). Reruns ending in 2 were still in progress and are not included.

Every claim was checked against the code and against a live in-memory DuckDB (DuckDB.NET.Data.Full 1.5.6.1) through throwaway xUnit probes before any fix was made.

Totals: 55 deduplicated findings. 18 confirmed (5 fixed, 1 by design and left for Andrew, 12 Low listed). 37 rejected.

Tests: before, 116 passed, 1 skipped, 117 total. After, 123 passed, 1 skipped, 124 total. The four new src regression tests failed against the original src.

# Finding (seats) Verdict Evidence
1 UPDATE ... RETURNING fallback fails on FK-referenced parent with any read-back column (Jenny H, Susie H) CONFIRMED High, FIXED Probe: "Constraint Error: Violates foreign key constraint because key "ParentId: 1" is still referenced"; now plain UPDATE + row-count check + SELECT by key; CouncilRound1Tests.Updating_a_referenced_parent_* failed before, passes after
2 Script lexer treats ELSE'\' / ESCAPE'\' as an E'' escape string (Jenny H) CONFIRMED Medium, FIXED DuckDB: SELECT CASE WHEN true THEN 'x' ELSE'\' END => x; runner threw FormatException "unterminated ... SQL literal"; Script_lexer_* failed before, passes after
3 Transaction parser knows 3 exact lines; bare BEGIN; runs raw, leaving an untracked transaction (Jenny M, Susie H) CONFIRMED Medium, FIXED Probe: "BEGIN; CREATE TABLE t3" ran OK with a raw BEGIN; "BEGIN; .. COMMIT;" threw Unmatched commit. BEGIN/BEGIN WORK/COMMIT TRANSACTION etc. now tracked, ROLLBACK/ABORT/unknown rejected at parse; Script_transaction_* failed before, passes after
4 Migrate tool reads stdin via Console.In: keeps UTF-8 BOM, decodes with console code page (Jenny M) CONFIRMED Medium, FIXED Old tool: BOM script => Parser Error at or near "CREATE"; no-BOM 'café' stored as 'caf├⌐' (63,61,66,251C,2310). New tool: exit 0, stored 'café' (63,61,66,E9). ScriptInput + Stdin_script_* test
5 Dollar-quote lexer opens a tag inside identifiers (a$b$c) and on $1 (Jenny M) CONFIRMED Low, FIXED DuckDB: SELECT 1 AS a$b => 1; runner entered a $b$ tag and failed closed; covered by Script_lexer_* test
6 Sub-microsecond DateTime/DateTimeOffset values throw, so DateTime.UtcNow fails ~90% of writes (Cyber H, Susie H) CONFIRMED, by design, NOT CHANGED Deliberate and documented: README.md:84-85, TypeMappingTests.Sub_microsecond_temporal_values_fail_*; needs Andrew's call (truncate vs reject)
7 nextval('"seq"') quoting breaks sequence lookup (Cyber H) REJECTED FunctionalTests.Crud_* and Async_crud_* insert through this default and get Id > 0; suite passes
8 ATTACH needs IF NOT EXISTS; reopen crashes (Cyber H) REJECTED EF never closes the in-memory connection (DuckDBRelationalConnection.CloseDbConnection); a real close destroys the :memory: catalog, so each physical open attaches once
9 ThrowIfInitializationFailed is dead code (Cyber M, Susie H) REJECTED Called from DuckDBRelationalConnection.Open/OpenAsync (Storage/DuckDBRelationalConnection.cs:14-24); QuackTests.Failed_attach_* covers it
10 Quack Data Source check bypassable through key aliases (Susie H) REJECTED Driver rejects aliases: "Database=" and "Filename=" => Unrecognized connection string property; only Data Source/DataSource exist and both are checked
11 Quack URI host not allowlisted; token sent anywhere (Susie H) REJECTED URI and token are application configuration, not request input
12 ATTACH literal quoting is an injection risk (Susie H) REJECTED Doubling ' is complete for DuckDB standard strings (backslash is literal outside E''); QuackTests.Attach_escapes_literals_* passes
13 Integer // is a comment / floors negatives (Cyber C, Susie M) REJECTED DuckDB: (-3)//2 => -1, (-7)::BIGINT//2 => -3, 7//2 => 3, truncating like C#; QueryTests executes it
14 uuid() does not exist (Cyber H) REJECTED SELECT uuid() returned ec247246-...; QueryTests.Date_parts_* executes it
15 current_localtimestamp() does not exist (Cyber H) REJECTED Returned 2026-10-30 00:55:54.229593
16 round_even does not exist (Cyber H) REJECTED round_even(2.5::DOUBLE, 0) => 2
17 timezone() needs the ICU extension (Cyber M) REJECTED timezone('UTC', CURRENT_TIMESTAMP) ran on DuckDB.NET.Data.Full with no LOAD
18 In-memory second open throws "already open" (Cyber C) REJECTED RelationalConnection skips OpenDbConnection when State is Open; Memory_database_survives_operations_* passes
19 Nullable CLR types cannot be mapped (Cyber C) REJECTED FindMapping(typeof(int?)) => INTEGER
20 ConfigureParameter skips base, DbType lost (Cyber C) REJECTED CreateParameter(int) => DbType Int32 (CreateParameter sets DbType; base ConfigureParameter is an empty hook)
21 $name parameters are invalid DuckDB syntax (Cyber H) REJECTED QueryTests.Limit_offset_and_reused_named_parameters_* executes $-named parameters
22 Delete: FileShare.Delete sharing violation, delete-pending, non-Windows throws (Cyber H) REJECTED File_database_create_exists_reopen_and_delete passes; non-Windows NotSupported is a documented choice
23 EnsureDeleted deletes an arbitrary DataSourcePath file (Susie H) REJECTED Deleting the configured database is the EnsureDeleted contract
24 In-memory Delete is a no-op; data survives (Susie H) REJECTED Memory_database_survives_operations_and_delete_resets_it asserts the set is empty after EnsureDeleted
25 WAL delete order / guard TOCTOU (Susie H) REJECTED as High (Low remains) Guard handles share Delete only, excluding other readers/writers; File_delete_refuses_to_unlink_* passes; a crash between the two deletes is Low
26 Decimal precision-only defaults scale to 0 (Susie H) REJECTED SQL-standard DECIMAL(p) = DECIMAL(p,0), same as EF SQL Server; README documents defaults
27 Modified command with zero write columns fails (Jenny H) REJECTED Probe: key-only entity set to Modified; SaveChanges OK (EF drops no-write commands)
28 Script runner executes arbitrary SQL (Susie H) REJECTED By design: documented for trusted, reviewed scripts (DuckDBMigrationScriptRunner.cs:9-12)
29 Row count -1 or 0 on same-value update gives false conflicts (Susie M) REJECTED Probe: same-value update (IsModified, unchanged value) saved OK with row count 1
30 Backtick identifiers break the lexer (Susie L) REJECTED DuckDB: SELECT 1 AS a => Parser Error at or near "`"
31 Bare ":memory:" breaks DbConnectionStringBuilder in the interceptor (Cyber M) REJECTED Driver itself rejects bare ":memory:" with the same format error
32 Cancellation marks a healthy connection failed (Cyber M) REJECTED Fail-closed by design; the connection is closed and its catalog is gone
33 ATTACH then USE is non-atomic; wrong-catalog fail-open (Susie M) REJECTED Any failure marks, closes and throws; no driver pooling returns a half-initialized connection
34 Service-provider hash 0 shares state across tenants (Susie M) REJECTED Connection and interceptors are not internal-provider services; standard EF pattern
35 UseQuack before UseDuckDB null-derefs (Susie M) REJECTED UseDuckDB adds the extension before invoking configure (DuckDBDbContextOptionsBuilderExtensions.cs:14-17)
36 Enum and char literals produce bad SQL (Cyber M) REJECTED EF applies enum/char value converters before the mapping; TypeMappingTests enum-conversion test passes
37 String + null yields NULL, unlike C# (Susie M) REJECTED Generated SQL: COALESCE("p"."Optional", '')
38 Math.Max/Min null semantics (Susie M) REJECTED greatest(NULL,5)=5, but Math.Max has no nullable overloads, so operands are non-null
39 StoreType interpolated into CAST (Susie M) REJECTED StoreType is model metadata restricted by the StoreTypes allow-list, not input
40 DateTime.Kind and original offset not preserved (Susie M) REJECTED Documented limitation, README.md:239
41 BLOB read disposes the reader stream (Susie M) REJECTED as defect (Low perf) Per-column stream; materializing before the reader advances is intentional; full buffering is a Low perf item
42 property.Builder may be null in the finalizing convention (Cyber L) REJECTED Builder is live during ModelFinalizing; the convention runs in every test model
43 TrimStart('$') name collision (Susie L) REJECTED EF never generates $$-prefixed names
44 string.Length counts code points; C# counts UTF-16 units (Susie M) CONFIRMED Low, not fixed length('😀') => 1, C# => 2; same as SQLite/Npgsql providers; document
45 CheckCount bypasses the concurrency-exception interceptor and logging (Jenny M) CONFIRMED Low, not fixed Throws DbUpdateConcurrencyException directly; diagnostics only
46 Runner sync-over-async; raw DbCommand bypasses interception; 30 s default timeout (Jenny M, Susie L) CONFIRMED Low, not fixed DuckDBMigrationScriptRunner Execute and step execution
47 IsRemote reads only option interceptors (Cyber M, Susie H) CONFIRMED Low, not fixed An interceptor registered only in an internal DI provider would be missed; the UseQuack path is correct
48 DeleteAsync is synchronous (Cyber M, Susie L) CONFIRMED Low, not fixed DuckDBDatabaseCreator.DeleteAsync calls Delete()
49 Remote Exists throws instead of returning false; no try/finally (Cyber M, Susie L) CONFIRMED Low, not fixed DuckDBDatabaseCreator.Exists
50 BLOB and DataSourcePath allocation churn (Cyber M) CONFIRMED Low, not fixed Perf only
51 Replace/Substring/Contains/ToLower edge cases differ from CLR exceptions or culture (Susie M/L) CONFIRMED Low, not fixed Server translation cannot raise CLR argument exceptions; same as other providers
52 Partial-migration autocommit; history read per guard (Susie M) CONFIRMED Low, not fixed EF scripts wrap each migration in BEGIN/COMMIT; document
53 Redacted Quack errors lose the cause; token kept as string; static failure table (Susie M/L) CONFIRMED Low, not fixed Redaction is intentional (QuackTests.Attach_failures_redact_*)
54 Tool: Ctrl+C handler never unsubscribed; repeat Ctrl+C swallowed (Jenny L) CONFIRMED Low, not fixed tools/EFCore.DuckDB.Migrate/Program.cs CancelKeyPress
55 Tool: connection string on argv; exception message echoed (Jenny L) CONFIRMED Low, not fixed tools/EFCore.DuckDB.Migrate/Program.cs

Legend: Clahadore = Claude, Cedric = Codex, Jenny = Gemini, Susie Franny = Muse.