mirror of
https://github.com/allankoechke/turso.git
synced 2026-11-30 11:12:58 +00:00
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:
committed by
Pekka Enberg
parent
8a31d96946
commit
409398c1e0
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user