Commit Graph

104 Commits

Author SHA1 Message Date
sonhmai
75f0cf9e20 chore: make clippy happy 2025-01-20 13:29:23 +07:00
Pekka Enberg
0abb917604 Limbo 0.0.13 2025-01-19 13:30:56 +02:00
Elijah Morgan
74ddc42df0 Add back integration tests
Fix package.json for better imports vs web/nodejs
Fix examples and integration tests
2025-01-18 15:01:16 -05:00
Elijah Morgan
6a7b269aa7 fixup dropped meta data 2025-01-16 21:30:36 -05:00
Elijah Morgan
c6d4484e63 bump versions 2025-01-16 21:29:19 -05:00
Elijah Morgan
f20a2d1334 Reorg to single package
Handle commonjs and esm module entry points

tests works
2025-01-16 21:29:19 -05:00
Elijah Morgan
f7be8b834b got vitest working
run via npm run test -w web
2025-01-16 21:29:19 -05:00
Elijah Morgan
02e4104932 reorg package structure
src moved under web/ to make it cleaner
build does less moving of files, mostly just moves the wasm-pack
into dist for node and web
2025-01-16 21:29:19 -05:00
Elijah Morgan
f75a1f89c4 WIP restructure
going to try out something different
2025-01-16 21:29:19 -05:00
Elijah Morgan
f81dfed922 Node and Web basic npm package test work 2025-01-16 21:29:16 -05:00
Elijah Morgan
8fa3a760c7 Web test of npm package works
Node one broke
2025-01-16 21:28:33 -05:00
Elijah Morgan
6bd40430bf Begin adding nodejs/web to a single npm package
Update build script to build both
Update package.json

Add basic test of node variant of npm package.
2025-01-16 21:28:29 -05:00
Pekka Enberg
b6ae8990e3 Limbo 0.0.12 2025-01-14 11:39:17 +02:00
Pekka Enberg
a369329988 Merge 'Add OPFS support to Wasm bindings' from Elijah Morgan
Lots of cleanup still left to do. Draft PR for adding support for OPFS
for WASM build (add support for limbo in browser).
Overall explanation of the architecture: this follows the sqlite wasm
architecture for OPFS.
main <> (limbo-worker.js) limbo (VFS - opfs.js) <> opfs-sync-proxy
The main thread loads limbo-worker.js which bootstraps the opfs.js and
opfs-sync-proxy.js and then launches the limbo-wasm.js.
At that point it can be used with worker.postmessage and
worker.onmessage interactions from the main thread.
The VFS provided by opfs.js provides a sync API by offloading async
operations to opfs-sync-proxy.js. This is done through SharedArrayBuffer
and Atomic.wait() to make the actual async operations appear synchronous
for limbo.
resolves #531

Closes #594
2025-01-07 10:36:18 +02:00
Elijah Morgan
c8232b019a commonize test code 2025-01-06 20:57:02 -05:00
Elijah Morgan
b9c94ba53c have tests run on different ports
cleanup tests cruft from trying to fix that issue
2025-01-06 20:42:37 -05:00
Elijah Morgan
ad9d372e9c cleanup
remove happy-dom
try to fix some issues with tests
add wasm-pack as devDependency
update versions
2025-01-06 19:22:20 -05:00
Pekka Enberg
ec9031dcf8 Improve JavaScript benchmarks 2025-01-05 20:43:55 +02:00
Pekka Enberg
daee7f8458 s/RowResult/StepResult/ 2025-01-05 20:24:26 +02:00
Pekka Enberg
5681603750 Merge 'Make iterate() lazily evaluated on wasm' from Diego Reis
#514
Introduces a new feature for lazy evaluation in the
`Statement.raw().iterate()` method and includes related changes in both
the test and implementation files. The most important changes include
adding a test case for lazy evaluation, creating a `RowIterator` struct,
and modifying the `iterate` method to use this new struct.
Everything seems to works fine, but suggestions on code improvement and
test use cases are welcoming.

Closes #527
2025-01-05 20:23:06 +02:00
Elijah Morgan
d51ca2150c Cleanup logging, move html files
General cleanup of cruft, deleted dead code, moved html files to clean
up dir.
2025-01-03 14:38:34 -05:00
Elijah Morgan
4bda7803c3 Add build for nodejs or web
Change how VFS gets loaded based on feature flags
2025-01-01 16:54:31 -05:00
Elijah Morgan
5765ccbfbb Add readme info
Add basic limbo-opfs-test.html
Remove unused browser-its structure - we may bring it back
2025-01-01 16:14:48 -05:00
Elijah Morgan
058ca89561 feat add basic opfs support and tests 2025-01-01 10:31:26 -05:00
Pekka Enberg
c4b0eb398c Limbo 0.0.11 2024-12-31 10:43:24 +02:00
PThorpe92
f6cd707544 Add clippy CI, fix or ignore warnings where appropriate 2024-12-29 10:25:41 -05:00
adamnemecek
97647ff056 Clean up code to use Self
Closes #556
2024-12-29 10:07:38 +02:00
Pekka Enberg
f2ecebc357 Rename RowResult to StepResult
The name "row result" is confusing because it really *is* a result from
a step() call. The only difference is how a row is represented as we
return from VDBE or from a statement.

Therefore, rename RowResult to StepResult.
2024-12-27 10:20:41 +02:00
Diego Reis
67c6409412 Add handling to busy row on RowIterator::next() 2024-12-26 15:40:04 -03:00
Diego Reis
d7be6f91cd Fix formating and pass on tests 2024-12-26 15:40:04 -03:00
Diego Reis
860e8af84d Remove .db files after tests execution 2024-12-26 15:40:04 -03:00
Diego Reis
7235336501 Update dependencies of wasm tests 2024-12-26 15:40:04 -03:00
Diego Reis
979115ee59 Remove unused variable on RowIterator 2024-12-26 15:40:04 -03:00
Diego Reis
901a534e0a Remove broken test due unimplemented SQL feature 2024-12-26 15:40:04 -03:00
Diego Reis
64414b888f Rollback js formatting to 4 spaces 2024-12-26 15:40:04 -03:00
Diego Reis
77c2b6f1a0 Make iterate() lazily evaluated on wasm 2024-12-26 15:40:04 -03:00
Pere Diaz Bou
aed14117c9 core: transaction support 2024-12-24 18:04:30 +01:00
Ziyak Jehangir
99d1b0e5a3 cleanup: replace &(*x) with x.as_ref() for smart pointer derefs 2024-12-19 19:36:04 +05:30
Pekka Enberg
e93ac38e55 Add statement interruption support
This adds an interrupt() method to Statement that allows apps to
interrupt a running statement. Please note that this is different from
`sqlite3_interrupt()` which interrupts all ongoing operations in a
database. Although we want to support that too, per statement interrupt
is much more useful to apps.
2024-12-19 12:30:32 +02:00
Pekka Enberg
69e3dd28f7 Limbo 0.0.10 2024-12-18 20:45:55 +02:00
Pekka Enberg
7943fa1e35 bindings/wasm: Add API reference document
The aim is towards libSQL/better-sqlite3 compatibility. Lift the API
reference document from libsql-js.git and update it accordingly to what
`limbo-wasm` supports.
2024-12-16 18:45:18 +02:00
Pere Diaz Bou
39a75147d4 Page cache by page_number and frame_number
Since page cache is now shared by default, we need to cache pages by
page number and something else. I chose to go with max_frame of
connection, because this connection will have a max_frame set until from
the start of a transaction until the end of it.

With key pairs of (pgno, max_frame) we make sure each connection is
caching based on the snapshot it is at as two different connections
might have the same pageno being using but a different frame. If both
have same max_frame then they will share same page.
2024-12-13 21:57:27 +01:00
Pere Diaz Bou
3fda2d09b9 Extract multi threaded part from WalFile to WalFileShared
Since we expect to ensure thread safety between multiple threads in the
future, we extract what is important to be shared between multiple
connections with regards to WAL.

This is WIP so I just put whatever feels like important behind a RwLock
but expect this to change to Atomics in the future as needed. Maybe even
these locks might disappear because they will be better served with
transaction locks.
2024-12-13 13:09:13 +01:00
Pere Diaz Bou
a4297702bd extract page cache to be multi threaded 2024-12-13 13:09:13 +01:00
Pekka Enberg
3023d228c7 Limbo 0.0.9 2024-12-12 18:49:05 +02:00
Pekka Enberg
36f9565910 Merge 'feat(wasm): add get and iterate func' from Jean Arhancet
Add `get` and `iterate` functions to the wasm module

Closes #421
2024-12-09 17:28:43 +02:00
JeanArhancet
5693cd1ae0 feat(wasm): add get and iterate func 2024-11-29 21:48:20 +01:00
Lauri Virtanen
a7100d8e9b Autofix clippy issues with cargo fix --clippy 2024-11-24 20:24:47 +02:00
Pekka Enberg
e1b2d043be Limbo 0.0.8 2024-11-20 19:16:11 +02:00
Pekka Enberg
a18f33f93b bindings/wasm: Add example using Drizzle ORM 2024-11-20 18:20:39 +02:00