Skip to content

Commit

Permalink
Merge pull request #644 from vlcn-io/fix-632
Browse files Browse the repository at this point in the history
move libsql specific vtab methods to fix #632
  • Loading branch information
psarna committed Nov 21, 2023
2 parents 1e97a62 + 02a5af3 commit cb0bcb0
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ members = [
"xtask",
]

exclude = [ "./libsql-sqlite3/ext/crr" ]

[profile.release]
codegen-units = 1
panic = "unwind"
Expand Down
3 changes: 2 additions & 1 deletion libsql-sqlite3/ext/crr/rs/core/src/create_cl_set_vtab.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ fn connect_create_shared(
base: sqlite::vtab {
nRef: 0,
pModule: core::ptr::null(),
pLibsqlModule: core::ptr::null(),
zErrMsg: core::ptr::null_mut(),
},
base_table_name: base_name_from_virtual_name(args.table_name).to_owned(),
Expand Down Expand Up @@ -259,7 +260,7 @@ static MODULE: sqlite_nostd::module = sqlite_nostd::module {
xRelease: None,
xRollbackTo: None,
xShadowName: None,
xPreparedSql: None,
xIntegrity: None,
};

pub fn create_module(db: *mut sqlite::sqlite3) -> Result<ResultCode, ResultCode> {
Expand Down
3 changes: 2 additions & 1 deletion libsql-sqlite3/ext/crr/rs/core/src/unpack_columns_vtab.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ extern "C" fn connect(
*vtab = Box::into_raw(Box::new(sqlite::vtab {
nRef: 0,
pModule: core::ptr::null(),
pLibsqlModule: core::ptr::null(),
zErrMsg: core::ptr::null_mut(),
}));
let _ = sqlite::vtab_config(db, sqlite::INNOCUOUS);
Expand Down Expand Up @@ -253,7 +254,7 @@ static MODULE: sqlite_nostd::module = sqlite_nostd::module {
xRelease: None,
xRollbackTo: None,
xShadowName: None,
xPreparedSql: None,
xIntegrity: None,
};

/**
Expand Down
3 changes: 1 addition & 2 deletions libsql-sqlite3/ext/crr/src/changes-vtab.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,5 +177,4 @@ sqlite3_module crsql_changesModule = {
/* xSavepoint */ 0,
/* xRelease */ 0,
/* xRollbackTo */ 0,
/* xShadowName */ 0,
/* xPreparedSql */ 0};
/* xShadowName */ 0};

0 comments on commit cb0bcb0

Please sign in to comment.