From 040f6bbb8e6b7f1b8a9b1413ff8d41fe3618ebb4 Mon Sep 17 00:00:00 2001 From: Avinash Sajjanshetty Date: Thu, 15 Feb 2024 19:19:40 +0530 Subject: [PATCH] build libsql --- .github/workflows/extensions-test.yml | 53 +++++++++++++++++++ .../ext/crr/rs/core/src/create_cl_set_vtab.rs | 4 +- .../crr/rs/core/src/unpack_columns_vtab.rs | 4 +- 3 files changed, 57 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/extensions-test.yml diff --git a/.github/workflows/extensions-test.yml b/.github/workflows/extensions-test.yml new file mode 100644 index 0000000000..aebd3967c0 --- /dev/null +++ b/.github/workflows/extensions-test.yml @@ -0,0 +1,53 @@ +name: Extensions Tests + +on: + push: + branches: [ "main" ] + pull_request: + merge_group: + branches: [ "main" ] + +env: + CARGO_TERM_COLOR: always + PROTOC_VERSION: 3.23.4 + +jobs: + c-tests: + runs-on: ubuntu-latest + name: CR SQLite C Tests + + steps: + - uses: hecrj/setup-rust-action@v1 + - name: Checkout repository + uses: actions/checkout@v3 + - name: build libsql + run: | + cd libsql-sqlite3 + ./configure + make libsql + - name: build + run: | + cd libsql-sqlite3/ext/crr + make loadable + - name: test + run: | + cd libsql-sqlite3/ext/crr + make test + + rs-tests: + runs-on: ubuntu-latest + name: CR SQLite Rust Tests + + steps: + - uses: hecrj/setup-rust-action@v1 + - name: Checkout repository + uses: actions/checkout@v3 + - name: build libsql + run: | + cd libsql-sqlite3 + ./configure + make libsql + - name: test + run: | + cd libsql-sqlite3/ext/crr/rs/core + cargo test --features=loadable_extension \ No newline at end of file diff --git a/libsql-sqlite3/ext/crr/rs/core/src/create_cl_set_vtab.rs b/libsql-sqlite3/ext/crr/rs/core/src/create_cl_set_vtab.rs index 34fd16839b..649cbafab0 100644 --- a/libsql-sqlite3/ext/crr/rs/core/src/create_cl_set_vtab.rs +++ b/libsql-sqlite3/ext/crr/rs/core/src/create_cl_set_vtab.rs @@ -140,8 +140,6 @@ fn connect_create_shared( nRef: 0, pModule: core::ptr::null(), zErrMsg: core::ptr::null_mut(), - #[cfg(feature = "libsql")] - pLibsqlModule: core::ptr::null_mut(), }, base_table_name: base_name_from_virtual_name(args.table_name).to_owned(), db_name: args.database_name.to_owned(), @@ -259,6 +257,8 @@ static MODULE: sqlite_nostd::module = sqlite_nostd::module { xRollbackTo: None, xShadowName: None, xIntegrity: None, + reserved: [None, None, None, None, None], + xPreparedSql: None, }; pub fn create_module(db: *mut sqlite::sqlite3) -> Result { diff --git a/libsql-sqlite3/ext/crr/rs/core/src/unpack_columns_vtab.rs b/libsql-sqlite3/ext/crr/rs/core/src/unpack_columns_vtab.rs index 036b419b00..bb12781a46 100644 --- a/libsql-sqlite3/ext/crr/rs/core/src/unpack_columns_vtab.rs +++ b/libsql-sqlite3/ext/crr/rs/core/src/unpack_columns_vtab.rs @@ -38,8 +38,6 @@ extern "C" fn connect( nRef: 0, pModule: core::ptr::null(), zErrMsg: core::ptr::null_mut(), - #[cfg(feature = "libsql")] - pLibsqlModule: core::ptr::null_mut(), })); let _ = sqlite::vtab_config(db, sqlite::INNOCUOUS); } @@ -256,6 +254,8 @@ static MODULE: sqlite_nostd::module = sqlite_nostd::module { xRollbackTo: None, xShadowName: None, xIntegrity: None, + reserved: [None, None, None, None, None], + xPreparedSql: None, }; /**