Skip to content

Commit 6d43d45

Browse files
committed
build bundles
1 parent e14762d commit 6d43d45

File tree

4 files changed

+67
-4
lines changed

4 files changed

+67
-4
lines changed

libsql-ffi/bundled/SQLite3MultipleCiphers/src/sqlite3.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69644,13 +69644,21 @@ static int sqlite3WalCheckpoint(
6964469644
*/
6964569645
if( eMode!=SQLITE_CHECKPOINT_PASSIVE ){
6964669646
rc = walBusyLock(pWal, xBusy2, pBusyArg, WAL_WRITE_LOCK, 1);
69647+
#ifndef LIBSQL_DISABLE_CHECKPOINT_DOWNGRADE
6964769648
if( rc==SQLITE_OK ){
6964869649
pWal->writeLock = 1;
6964969650
}else if( rc==SQLITE_BUSY ){
6965069651
eMode2 = SQLITE_CHECKPOINT_PASSIVE;
6965169652
xBusy2 = 0;
6965269653
rc = SQLITE_OK;
6965369654
}
69655+
#else
69656+
// checkpoint downgrade can be undesirable behaviour especially in case of custom VWal implementation
69657+
// LIBSQL_DISABLE_CHECKPOINT_DOWNGRADE compile time option disables downgrade of checkpoint mode
69658+
if( rc==SQLITE_OK ){
69659+
pWal->writeLock = 1;
69660+
}
69661+
#endif
6965469662
}
6965569663
}
6965669664

libsql-ffi/bundled/bindings/bindgen.rs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -940,7 +940,7 @@ extern "C" {
940940
extern "C" {
941941
pub fn sqlite3_vmprintf(
942942
arg1: *const ::std::os::raw::c_char,
943-
arg2: va_list,
943+
arg2: *mut __va_list_tag,
944944
) -> *mut ::std::os::raw::c_char;
945945
}
946946
extern "C" {
@@ -956,7 +956,7 @@ extern "C" {
956956
arg1: ::std::os::raw::c_int,
957957
arg2: *mut ::std::os::raw::c_char,
958958
arg3: *const ::std::os::raw::c_char,
959-
arg4: va_list,
959+
arg4: *mut __va_list_tag,
960960
) -> *mut ::std::os::raw::c_char;
961961
}
962962
extern "C" {
@@ -2506,7 +2506,7 @@ extern "C" {
25062506
pub fn sqlite3_str_vappendf(
25072507
arg1: *mut sqlite3_str,
25082508
zFormat: *const ::std::os::raw::c_char,
2509-
arg2: va_list,
2509+
arg2: *mut __va_list_tag,
25102510
);
25112511
}
25122512
extern "C" {
@@ -3573,4 +3573,12 @@ extern "C" {
35733573
extern "C" {
35743574
pub static sqlite3_wal_manager: libsql_wal_manager;
35753575
}
3576-
pub type __builtin_va_list = *mut ::std::os::raw::c_char;
3576+
pub type __builtin_va_list = [__va_list_tag; 1usize];
3577+
#[repr(C)]
3578+
#[derive(Debug, Copy, Clone)]
3579+
pub struct __va_list_tag {
3580+
pub gp_offset: ::std::os::raw::c_uint,
3581+
pub fp_offset: ::std::os::raw::c_uint,
3582+
pub overflow_arg_area: *mut ::std::os::raw::c_void,
3583+
pub reg_save_area: *mut ::std::os::raw::c_void,
3584+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// Generated by build.rs
2+
3+
4+
#include "sqlite3.c"
5+
SQLITE_EXTENSION_INIT1
6+
7+
#include "crypto/extension.h"
8+
#include "fuzzy/extension.h"
9+
#include "math/extension.h"
10+
#include "stats/extension.h"
11+
#include "text/extension.h"
12+
#include "uuid/extension.h"
13+
14+
#include "sqlean.h"
15+
16+
static void sqlean_version(sqlite3_context* context, int argc, sqlite3_value** argv) {
17+
sqlite3_result_text(context, SQLEAN_VERSION, -1, SQLITE_STATIC);
18+
}
19+
20+
#ifdef _WIN32
21+
__declspec(dllexport)
22+
#endif
23+
int sqlite3_sqlean_init(sqlite3* db, char** errmsg_ptr, const sqlite3_api_routines* api) {
24+
(void)errmsg_ptr;
25+
SQLITE_EXTENSION_INIT2(api);
26+
static const int flags = SQLITE_UTF8 | SQLITE_INNOCUOUS | SQLITE_DETERMINISTIC;
27+
sqlite3_create_function(db, "sqlean_version", 0, flags, 0, sqlean_version, 0, 0);
28+
crypto_init(db);
29+
fuzzy_init(db);
30+
math_init(db);
31+
stats_init(db);
32+
text_init(db);
33+
uuid_init(db);
34+
return SQLITE_OK;
35+
}
36+
37+
int core_init(const char* dummy) {
38+
return sqlite3_auto_extension((void*)sqlite3_sqlean_init);
39+
}

libsql-ffi/bundled/src/sqlite3.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69644,13 +69644,21 @@ static int sqlite3WalCheckpoint(
6964469644
*/
6964569645
if( eMode!=SQLITE_CHECKPOINT_PASSIVE ){
6964669646
rc = walBusyLock(pWal, xBusy2, pBusyArg, WAL_WRITE_LOCK, 1);
69647+
#ifndef LIBSQL_DISABLE_CHECKPOINT_DOWNGRADE
6964769648
if( rc==SQLITE_OK ){
6964869649
pWal->writeLock = 1;
6964969650
}else if( rc==SQLITE_BUSY ){
6965069651
eMode2 = SQLITE_CHECKPOINT_PASSIVE;
6965169652
xBusy2 = 0;
6965269653
rc = SQLITE_OK;
6965369654
}
69655+
#else
69656+
// checkpoint downgrade can be undesirable behaviour especially in case of custom VWal implementation
69657+
// LIBSQL_DISABLE_CHECKPOINT_DOWNGRADE compile time option disables downgrade of checkpoint mode
69658+
if( rc==SQLITE_OK ){
69659+
pWal->writeLock = 1;
69660+
}
69661+
#endif
6965469662
}
6965569663
}
6965669664

0 commit comments

Comments
 (0)