fix(data): probe PRAGMA compile_options next to the SQLite version check

BRIEF §6.2 asks for the probe at startup. The options are read once per process
from an in-memory connection, logged with the library version and added to the
desktop diagnostics bundle; nothing depends on them (no FTS or JSON use).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
Claude committed 2026-10-12 09:58:26 +00:00
1 parent 61e61702c6
commit 61d913baa9
3 files changed
+70 -2

No files matched your search

@@ -15,6 +15,19 @@ public sealed class SqliteBindingTests(TestContext context) : DatabaseTest(conte
Assert.True(parts[0] > 3 || (parts[0] == 3 && parts[1] >= 31), $"SQLite {SqliteDatabase.LibraryVersion}");
}
[Test]
public async Task CompileOptionsAreProbedOnceAndMatchTheLibrary()
{
await using var database = await OpenDatabaseAsync();
var options = SqliteDatabase.CompileOptions;
// Informational and probed once: the same list on every call, and what any connection reports.
Assert.Same(options, SqliteDatabase.CompileOptions);
await using var session = await database.OpenAsync(Ct);
Assert.SequenceEqual(await session.QueryListAsync("PRAGMA compile_options", [], r => r.GetString(0), Ct), options);
// Linux libraries keep the diagnostics (a Windows build may omit them, which leaves the list empty).
if (!OperatingSystem.IsWindows()) Assert.Contains(options, o => o.StartsWith("THREADSAFE=", StringComparison.Ordinal));
}
[Test]
public async Task ConnectionsUseTheBriefPragmas()
{