bindings/dotnet: match SDK database config ABI

Keep the existing .NET binding compatible with the expanded SDK-kit database config by carrying explicit zero values for the new page-codec pointer and open-flags fields. Without this, the native side reads stack garbage as open flags and all .NET connection tests fail before opening a database.

Tests: dotnet test .\bindings\dotnet\src\Turso.Tests\Turso.Tests.csproj --filter FullyQualifiedName~ExecutesCommonAdoNetQuery --no-restore --verbosity minimal

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Marc-André Moreau
2026-08-04 10:31:15 -04:00
committed by Pekka Enberg
parent 8a31d96946
commit 409398c1e0
3 changed files with 6 additions and 0 deletions

View File

@@ -301,6 +301,8 @@ public static class TursoBindings
Vfs = IntPtr.Zero,
EncryptionCipher = cipherString.Pointer,
EncryptionHexKey = hexkeyString.Pointer,
PageCodec = IntPtr.Zero,
OpenFlags = 0,
};
var status = TursoInterop.DatabaseNew(ref config, out var databasePtr, out var errorPtr);

View File

@@ -43,6 +43,8 @@ internal struct TursoDatabaseConfig
public IntPtr Vfs;
public IntPtr EncryptionCipher;
public IntPtr EncryptionHexKey;
public IntPtr PageCodec;
public uint OpenFlags;
}
internal static class TursoInterop

View File

@@ -98,6 +98,8 @@ fn test_sdk_close_finalizes_leaked_statements() {
vfs: IoBackend::Default,
io: None,
db_file: None,
page_codec: None,
open_flags: OpenFlags::default(),
});
let _ = db_a.open().unwrap();
let conn_a = db_a.connect().unwrap();