Skip to content

Commit

Permalink
build libsql
Browse files Browse the repository at this point in the history
  • Loading branch information
avinassh committed Feb 15, 2024
1 parent 5cc12d7 commit 040f6bb
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 4 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/extensions-test.yml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions libsql-sqlite3/ext/crr/rs/core/src/create_cl_set_vtab.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down Expand Up @@ -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<ResultCode, ResultCode> {
Expand Down
4 changes: 2 additions & 2 deletions libsql-sqlite3/ext/crr/rs/core/src/unpack_columns_vtab.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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,
};

/**
Expand Down

0 comments on commit 040f6bb

Please sign in to comment.