0
0
mirror of https://github.com/tursodatabase/libsql.git synced 2025-07-04 18:23:37 +00:00
Commit Graph

39 Commits

Author SHA1 Message Date
ae9daa8b74 Use NonZeroU32 for frame_no and page_no 2023-12-05 09:20:44 +01:00
4ae365b557 fix review nits 2023-11-30 11:26:49 +01:00
49b11abce0 homogenise rust wal naming 2023-11-30 11:26:49 +01:00
3d7c3c0a5f static initialization of sqlite3wal rc 2023-11-30 11:26:49 +01:00
05f6d47643 make pager's wal a pointer 2023-11-30 11:26:44 +01:00
b426b236b0 restore deprecated libsql open methods, introduce v3 2023-11-30 11:25:22 +01:00
2125e633b9 static sqlite3 wal 2023-11-30 11:25:22 +01:00
ff53bcbc57 rename libsql_create_wal to libsql_wal_manager 2023-11-30 11:25:22 +01:00
100c52cbb5 fix rust tests 2023-11-30 11:24:52 +01:00
217ecb84b5 sqlite3 virtual wal v2
Refactor of the virtual wal API. Drop global wals in favor of passing
the wal implementation as an argument to libsql_open.

The WAL interface is split in two sets of virtual methods:
- `create_wal` is passed when opening a sqlite connection. It's role is
  to instantiate a wal.
- `libql_wal` is the wal itself, created by the `create_wal`.

The sqlite3_wal and `sqlite3_create_wal` implementation are completely
decoupled from the wal implementation. They are the default
implementation when using the traditional open methods, and
sqlite3_create_wal is exposed as a global variable, and can be composed
with other wal implementations.
2023-11-30 11:24:47 +01:00
a56ee2f615 ext/wasm: fix SQLTester path
It was moved incorrectly due to the migration of the C API
to libsql-sqlite3/ subdirectory.
2023-11-29 16:53:59 +01:00
6b3430c10d windows,sqliteInt: skip SEH
We're not committing to SEH support due to virtual WAL
incompatibility reasons.
2023-11-29 15:17:40 +01:00
d89f0b4d8c wasi: add virtual WAL stub
On top of a special VFS, `make wasi` now also compiles-in
a specialized virtual WAL methods module. It doesn't do anything
right now (just falls back to the regular implementation),
but can be used to call back to the host, inject hooks, etc.
2023-11-29 09:27:24 +01:00
822b2e1b81 Merge pull request from psarna/extwasmwal
ext/wasm: allow WAL mode
2023-11-28 08:37:48 +00:00
dfa4ce43c0 ext/wasm: allow WAL mode
All the groundwork was there for WASI anyway.
2023-11-28 09:26:28 +01:00
1445e42483 wasi: add poor man's microbenchmark 2023-11-28 09:00:49 +01:00
a5cd4f3d81 wasi: refactor to libsql-wasi crate
The crate still has a main.rs file for demo purposes,
but the logic is extracted to a library.
2023-11-27 09:49:33 +01:00
3b0d30f7af wasi,demo: add creating a table 2023-11-26 14:19:50 +01:00
52bf745b32 apply clippy 2023-11-26 14:17:16 +01:00
7cb1eee19c wasi: implement the rest of VFS 2023-11-26 14:17:16 +01:00
d2c3b1eadc wasi: add close() 2023-11-26 14:17:16 +01:00
0bbf971c61 wasi: add write support 2023-11-26 14:17:16 +01:00
9974e2c745 wasi: implement stub for reading files 2023-11-26 14:17:16 +01:00
6113da3db9 wasi: ensure exclusive locking mode and WAL journaling 2023-11-26 14:17:16 +01:00
15a6e43c3c wasi: add WASI demo stub
It's far from working, but it already properly calls back
from a WebAssembly instance to the host for VFS operations.
We also want the same for virtual WAL and we'll have a solid foundation
for running libSQL in a Wasm runtime.
2023-11-26 14:17:16 +01:00
b1bbbf05c7 wasi: add vfs.c to the build path 2023-11-26 14:17:16 +01:00
dc75074a37 wasi: add WASI VFS stub 2023-11-26 14:17:16 +01:00
cc9bcb1e15 wasm: add make wasi command
It is not directly tested or usable yet, and depends on having
wasi-libc library available at /usr/share/wasi-sysroot.

Still, it compiled, so it's a nice start.

`make wasi` produces `libsql.wasm` module.
Future work includes using this module to run a WebAssembly app
in a runtime that supports WASI, using `libsql.wasm` as the database
implementation.

The patch is based on splitting SQLITE_OMIT_WAL into SQLITE_OMIT_SHARED_MEM,
so that we can still compile WAL mode, just without shared memory,
so still usable with exclusive mode or via libSQL's virtual WAL.
2023-11-23 19:55:56 +01:00
02a5af3040 move libsql specific vtab methods to fix 2023-11-17 11:10:33 -05:00
ab44a0a24f .gitignore: update 2023-11-16 09:34:39 +01:00
e56bdbd521 vdbe,sqlite.h: introduce libsql_module
The libSQL extensions are moved to the libsql_module struct
with its accompanying libsql_create_module interface.
It's a breaking change, because we were lazy before and just appended
xPreparedSql call right at the end of the sqlite3_module struct
and it diverged upstream :(
2023-11-16 09:33:19 +01:00
607d1cff7b sqlite.h: bring back xIntegrity before xPreparedSql 2023-11-15 16:00:08 +01:00
f5dc919cbc LIBSQL_VERSION: bump to 0.2.3
Based on SQLite 3.44.0
2023-11-15 14:54:26 +01:00
0dfca64aa3 Merge tag 'version-3.44.0' into HEAD 2023-11-15 14:46:34 +01:00
17d91adf32 Fix mistakenly moved CODE_OF_CONDUCT.md from libsql-sqlite3 to root dir 2023-11-05 13:18:41 +09:00
a9481c8326 remove unused deps 2023-10-30 17:26:20 +01:00
a55c84f33c ext/crr: update to 0.15.1 of cr-sqlite
Based on https://github.com/tursodatabase/libsql/pull/434
and rebased.
2023-10-18 13:46:23 +02:00
e7ca93a902 fix ci 2023-10-16 15:25:18 +02:00
bf899d0b9a restructure repository 2023-10-16 13:58:16 +02:00