mirror of
https://github.com/aljazceru/turso.git
synced 2026-02-20 07:25:14 +01:00
Add error codes to C bindings
This commit is contained in:
3
core/mvcc/bindings/c/src/errors.rs
Normal file
3
core/mvcc/bindings/c/src/errors.rs
Normal file
@@ -0,0 +1,3 @@
|
||||
pub const MVCC_OK: i32 = 0;
|
||||
|
||||
pub const MVCC_IO_ERROR_WRITE: i32 = 778;
|
||||
@@ -1,8 +1,10 @@
|
||||
#![allow(non_camel_case_types)]
|
||||
|
||||
mod errors;
|
||||
mod types;
|
||||
|
||||
use types::{MVCCDatabaseRef, DbContext};
|
||||
use errors::*;
|
||||
use mvcc_rs::*;
|
||||
|
||||
/// cbindgen:ignore
|
||||
@@ -81,11 +83,11 @@ pub unsafe extern "C" fn MVCCDatabaseInsert(
|
||||
}) {
|
||||
Ok(_) => {
|
||||
tracing::debug!("MVCCDatabaseInsert: success");
|
||||
0 // SQLITE_OK
|
||||
MVCC_OK
|
||||
}
|
||||
Err(e) => {
|
||||
tracing::error!("MVCCDatabaseInsert: {e}");
|
||||
778 // SQLITE_IOERR_WRITE
|
||||
MVCC_IO_ERROR_WRITE
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user