Commit Graph

84 Commits

Author SHA1 Message Date
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
Samyak S Sarnayak
c09a0bcbf3 Nicer parse errors using miette
I noticed that the parse errors were a bit hard to read - only the nearest token and the line/col offsets were printed.

I made a first attempt at improving the errors using [miette](https://github.com/zkat/miette).
- Added derive for `miette::Diagnostic` to both the parser's error type and LimboError.
- Added miette dependency to both sqlite3_parser and core. The `fancy` feature is only enabled for CLI.

Some future improvements that can be made further:
- Add spans to AST nodes so that errors can better point to the correct token. See upstream issue: https://github.com/gwenn/lemon-rs/issues/33
- Construct more errors with offset information. I noticed that most parser errors are constructed with `None` as the offset.

Comparisons.
Before:
```
❯ cargo run --package limbo --bin limbo database.db --output-mode pretty
...
limbo> selet * from a;
[2025-01-05T11:22:55Z ERROR sqlite3Parser] near "Token([115, 101, 108, 101, 116])": syntax error
Parse error: near "selet": syntax error at (1, 6)
```

After:
```
❯ cargo run --package limbo --bin limbo database.db --output-mode pretty
...
limbo> selet * from a;
[2025-01-05T12:25:52Z ERROR sqlite3Parser] near "Token([115, 101, 108, 101, 116])": syntax error

  × near "selet": syntax error at (1, 6)
   ╭────
 1 │ selet * from a
   ·     ▲
   ·     ╰── syntax error
   ╰────

```
2025-01-05 17:56:59 +05:30
김선우
370e1ca5c2 Add support Java bindings
This add support for Java bindings in the bindings/java directory.
2025-01-05 10:28:05 +02:00
psvri
1f21cf6a71 Feat: Import csv support 2025-01-03 15:20:22 +05:30
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
Jussi Saurio
8c9bd0deb9 chore: commit cargo lock changes from #553 2024-12-29 08:58:26 +02:00
Pekka Enberg
37e1f35df8 Fix Cargo.toml in macros crate 2024-12-25 11:54:16 +02:00
Pekka Enberg
ffd1c725ee Merge 'Simulator improvements' from Alperen Keleş
This PR makes two small incremental updates:
1- It adds a Clap CLI for simulator configuration, using the same Clap
version as the Limbo cli crate
2- It creates a new submodule called `simulator`, moving simulator
related structs from the large main file into their own files.
I am open to suggestions on the submodule name instead of `simulator` as
it's kind of weird to have `simulator/simulator` in the file tree.

Closes #540
2024-12-25 09:41:17 +02:00
alpaylan
9f08b621ec add clap CLI for configuring the simulator 2024-12-22 17:06:46 -05:00
PThorpe92
fcab0ae299 Add uuid support for v4 and v7 2024-12-21 09:13:46 -05:00
vignesh-j-shetty
a43a1d204c renamed macro crate 2024-12-21 13:19:04 +05:30
vignesh-j-shetty
1e72fee343 Implemented proc_macro_derive extract description from rust docs and generate get_description function 2024-12-21 12:23:04 +05:30
Diego Reis
3a0e56bca5 Implement basic sqlite3_get_table() API 2024-12-19 23:13:51 -03:00
Pekka Enberg
69e3dd28f7 Limbo 0.0.10 2024-12-18 20:45:55 +02:00
Pekka Enberg
636b78d4ff Merge 'Minimal cargo-c support' from Luca Barbato
Fixes #437

Closes #458
2024-12-15 09:30:12 +02:00
Luca Barbato
eacbba2c07 Minimal cargo-c support 2024-12-14 15:19:50 +01:00
Pere Diaz Bou
1a663a6ed7 cargo stuff rm 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
617f95c7b6 Update clap to 4.5
The Github dependabot complains about anstream, which comes through `clap`:

https://github.com/tursodatabase/limbo/security/dependabot/8
2024-12-11 14:39:27 +02:00
Pekka Enberg
ab07c77036 Upgrade pprof to 0.14
Github's dependabot complains that the current version has an unsoudness
issue so let's bump to a newer version:

https://github.com/tursodatabase/limbo/security/dependabot/10
2024-12-11 11:21:09 +02:00
Pekka Enberg
e1b2d043be Limbo 0.0.8 2024-11-20 19:16:11 +02:00
Pekka Enberg
81b68b7047 Limbo 0.0.7 2024-11-20 18:15:36 +02:00
Pekka Enberg
fc07445e0a Merge 'sim: improve simulator' from Pere Diaz Bou
Newly improved simulator with CREATE TABLE, INSERT, SELECT, connection
management, etc...
This new simulator is finding a bunch of bugs with write path so after
this PR I will start fixing those.

Closes #405
2024-11-20 08:59:13 +02:00
Pekka Enberg
0fb1e59c9a Limbo 0.0.6 2024-11-18 19:16:15 +02:00
Pekka Enberg
a83e62f6f4 Limbo 0.0.5 2024-11-18 14:57:00 +02:00
Pere Diaz Bou
44e22c50cf sim: improve simulator 2024-11-18 13:40:37 +01:00
jussisaurio
3cc9d9d79f vendor sqlite3-parser (lemon-rs) 2024-11-16 20:08:59 +02:00
Pekka Enberg
9473668196 core: Bump jsonb dependency
The `fast-float` library has soundness issues, which why `jsonb`
switched to `fast-float2`:

https://github.com/databendlabs/jsonb/issues/68
2024-11-16 18:58:13 +02:00
Pekka Enberg
17c7e8d346 sqlite3: Disable env_logger default features
Let's keep the dependencies as light-weight as possible.
2024-11-16 09:47:12 +02:00
Pekka Enberg
c3da75d260 build: Enable LTO for release builds
This reduces `liblimbo_sqlite3.a` binary size from 25 MB to 10 MB:

Before:

  $ -lh ../target/release/liblimbo_sqlite3.a
  -rw-r--r--  1 penberg  staff    25M 15 Mar 18:36 ../target/release/liblimbo_sqlite3.a

After:

  $ penberg@vonneumann sqlite3 % ls -lh ../target/release/liblimbo_sqlite3.a
  -rw-r--r--  1 penberg  staff   9,9M 15 Mar 18:59 ../target/release/liblimbo_sqlite3.a
2024-11-15 19:06:17 +02:00
Pekka Enberg
b7ca2c9823 bindings/wasm: Add Database.prepare() and Statement.all()
This adds `Database.prepare()` and `Statement.all()` APIs to the Wasm
bindings so that you can actually get something useful out of the
library.
2024-11-13 12:22:35 +02:00
baishen
5c00c576a5 Add support for hex scalar function 2024-09-22 08:50:08 -04:00
김선우
7f5d9dbb90 Apply fmt 2024-09-16 22:00:36 +09:00
김선우
f592ed15c1 Add test to verify root and leaf splitting 2024-09-16 16:50:30 +09:00
김선우
ff1c38e0bb Rewrite test to use temp dir 2024-09-15 17:31:55 +09:00
Pere Diaz Bou
270193b953 use rustqlite 2024-09-13 09:15:55 +02:00
Pere Diaz Bou
1ea496a169 core_tester: sequential btree write test
Signed-off-by: Pere Diaz Bou <pere-altea@hotmail.com>
2024-09-05 20:50:30 +02:00
Pekka Enberg
b1f508db87 Limbo 0.0.4 2024-08-22 17:44:28 +03:00
Pekka Enberg
e30b5f1082 Commit updated Cargo.lock and sqlite3.h
Turns out the new cbindgen version generates slightly different
sqlite3.h so commit that to the tree. The version in Cargo.lock also
changed so let's check in that too.
2024-08-15 19:42:10 +03:00
Pekka Enberg
f633fc91cf sqlite3: Add to cargo dist bundle 2024-08-11 12:14:43 +03:00
JeanArhancet
7c362b129f feat: impl python binding
refactor: pep-0249

refactor: rust comment and requirements-dev.txt

fix: name conflict
2024-08-11 08:58:18 +02:00
Pekka Enberg
5219fc7258 Update cbindgen dependency
Fixes #63
2024-08-10 14:29:20 +03:00
Pekka Enberg
5b7d112e74 Merge 'implementation of json function json(X)' from Jean Arhancet
Add the `json` function `json(X)` (related to the issue https://github.com/penberg/limbo/issues/127)

Closes #230
2024-08-06 08:05:33 +03:00
JeanArhancet
4050a3ebe2 refactor: impl json5 direclty 2024-08-04 12:47:08 +02:00
JeanArhancet
552090cb29 feat: add json support 2024-08-04 10:54:27 +02:00
Pekka Enberg
7df979cd3a wasm: Enable console.error() panic hook
Makes debugging a little bit easier...
2024-08-04 09:45:27 +03:00
JeanArhancet
38a1b85094 fix: ctrl-c stop current query execution 2024-08-03 22:58:52 +02:00
Pekka Enberg
cb34deef09 Limbo 0.0.3 2024-08-01 18:57:13 +03:00
Pekka Enberg
351242561d Kill anyhow usage
Switch anyhow to explicit `LimboError` type using thiserror crate, which
lets us make error handling more structured.
2024-07-25 17:15:08 +03:00