Commit Graph

2947 Commits

Author SHA1 Message Date
[B
e52f218136 fix format 2025-02-14 21:10:51 +01:00
[B
5214cf9859 Added IdxLE and IdxLT opcodes 2025-02-14 20:22:30 +01:00
Pekka Enberg
d9f4558255 build: Clean up top-level Cargo.toml 2025-02-14 12:43:17 +02:00
Pekka Enberg
a302828376 core/transalte: Fix invalid sqlite3_parser import 2025-02-14 12:27:57 +02:00
Pekka Enberg
43574528c9 Merge 'Switch to workspace dependencies' from Pekka Enberg
...makes it easier to specify a version, which is needed for `cargo
publish`.

Closes #991
2025-02-14 12:21:24 +02:00
Pekka Enberg
64cdfd829e Merge 'core/translate: BEGIN EXCLUSIVE support' from Pekka Enberg
After reading the fine print, SQLite documentation explains that `BEGIN
IMMEDIATE` and `BEGIN EXCLUSIVE` are the same thing in WAL mode:
https://www.sqlite.org/lang_transaction.html
As that's the only mode we support, let's just add code generation for
`BEGIN EXCLUSIVE`.
Fixes #1002

Closes #1003
2025-02-14 12:20:22 +02:00
Pekka Enberg
20e881ae0d testing: Disable transaction tests for now 2025-02-14 12:19:58 +02:00
Pekka Enberg
e3925c4531 core/vdbe: Fix Program::halt() to respect autocommit state 2025-02-14 12:11:37 +02:00
Pekka Enberg
b949ef5360 Update COMPAT.md 2025-02-14 11:58:54 +02:00
Pekka Enberg
76bdbb54ef core/translate: BEGIN EXCLUSIVE support
After reading the fine print, SQLite documentation explains that `BEGIN
IMMEDIATE` and `BEGIN EXCLUSIVE` are the same thing in WAL mode:

https://www.sqlite.org/lang_transaction.html

As that's the only mode we support, let's just add code generation for
`BEGIN EXCLUSIVE`.

Fixes #1002
2025-02-14 11:52:18 +02:00
Pekka Enberg
567a2e9a9f Merge 'BEGIN IMMEDIATE + COMMIT support' from Pekka Enberg
Closes #1000
2025-02-14 11:48:38 +02:00
Pekka Enberg
ae3c6b7ec5 core/vdbe: Fix AutoCommit instruction to halt the VM
Pointed out by Jussi
2025-02-14 11:43:16 +02:00
Pekka Enberg
948585bb42 core/vdbe: Extract Program::halt() helper
We need this for AutoCommit opcode too.
2025-02-14 11:42:24 +02:00
Pekka Enberg
4b7270de11 Merge 'fix some typo' from meteorgan
Closes #999
2025-02-14 10:37:40 +02:00
Pekka Enberg
a8cadf205c Merge 'doc: Use limbo_cli as package instead for running limbo cli' from Takayuki Maeda
I found invalid option while reading CONTRIBUTING.md and trying some
commands in it.
error:
```
$ cargo run --package limbo --bin limbo database.db
error: no bin target named `limbo`.

$ rustc --version
rustc 1.83.0 (90b35a623 2024-11-26)
```
ref: https://github.com/tursodatabase/limbo/blob/291637cc7120303fd7337c3
42cf5dbc9363faa85/cli/Cargo.toml#L17

Closes #995
2025-02-14 10:35:42 +02:00
Pekka Enberg
076331d8cf testing: Basic BEGIN + END test 2025-02-14 10:26:55 +02:00
Pekka Enberg
5626ca450f core/translate: COMMIT support
```
limbo> EXPLAIN COMMIT;
addr  opcode             p1    p2    p3    p4             p5  comment
----  -----------------  ----  ----  ----  -------------  --  -------
0     Init               0     3     0                    0   Start at 3
1     AutoCommit         1     0     0                    0   auto_commit=true, rollback=false
2     Halt               0     0     0                    0
3     Goto               0     1     0                    0
```
2025-02-14 10:26:55 +02:00
Pekka Enberg
9fff9f6081 core/translate: BEGIN IMMEDIATE support
Emit the following code sequence for `BEGIN IMMEDIATE`:

```
limbo> EXPLAIN BEGIN IMMEDIATE;
addr  opcode             p1    p2    p3    p4             p5  comment
----  -----------------  ----  ----  ----  -------------  --  -------
0     Init               0     4     0                    0   Start at 4
1     Transaction        0     1     0                    0
2     AutoCommit         0     0     0                    0   auto_commit=false, rollback=false
3     Halt               0     0     0                    0
4     Goto               0     1     0                    0
```

Please note that SQLite emits *two* transaction instructions -- one for
main database and one for temporary tables. However, since we don't
support the latter, we only emit one transaction instruction.
2025-02-14 10:26:31 +02:00
Pekka Enberg
34b0c7c09a core/vdbe: AutoCommit instruction 2025-02-14 10:26:31 +02:00
Takayuki Maeda
291637cc71 use limbo_cli instead 2025-02-14 01:45:33 +09:00
meteorgan
744df6eedf fix some typo 2025-02-13 23:03:41 +08:00
Takayuki Maeda
e9b4d933b5 remove unnecessary option for running limbo cli 2025-02-13 05:00:43 +09:00
Pekka Enberg
248a369afc Merge 'build: Update cargo-dist to latest' from Pekka Enberg
Closes #992
2025-02-12 18:13:05 +02:00
Pekka Enberg
d63be7492d build: Update cargo-dist to latest 2025-02-12 17:30:02 +02:00
Pekka Enberg
ac54c35f92 Switch to workspace dependencies
...makes it easier to specify a version, which is needed for `cargo publish`.
2025-02-12 17:28:04 +02:00
Pekka Enberg
e464f99234 Revert "github: Update to "ubuntu-22.04" image"
This reverts commit bb8ab4088b. We need `cargo-dist` to do this...
2025-02-12 17:20:33 +02:00
Pekka Enberg
d1e8bb986f Fix RustDoc imports 2025-02-12 17:17:33 +02:00
Pekka Enberg
2e5fc62c45 bindings/rust: Add example.rs 2025-02-12 16:55:05 +02:00
Pekka Enberg
0b83e98031 bindings/rust: Make "limbo_core" workspace dependency 2025-02-12 16:53:41 +02:00
Pekka Enberg
c612b0932e bindings/rust: Rename crate to "limbo" 2025-02-12 16:49:53 +02:00
Pekka Enberg
a8a22e412c github: Add timeout to compatibility tests
...one job was running non-stop for an hour, which is clearly not right.
2025-02-12 09:56:39 +02:00
Pekka Enberg
01671d1d1e Merge 'Performance improvements for Unix I/O backend' from Preston Thorpe
This PR reworks the unix I/O backend, removing runtime reference
counting/borrow checking and optimizing away the hashmap in favor of a
static array, with an unlikely fallback vec.
The only reason the fallback vec is there is because unlike the
`io_uring` module, we cannot simply index into the array with the fd  as
the OS could theoretically give us a fd up to I believe 1024 so keeping
an array of that size for a few elements is unnecessary.

Closes #940
2025-02-12 09:29:41 +02:00
Pekka Enberg
e4d4e5cd5d Merge 'Streamline dependencies to build for all wasm targets' from Doug A
In order [experimentally
compile](https://github.com/DougAnderson444/wit-limbo) `limbo_core` to a
[wasm component](https://component-model.bytecodealliance.org/), limbo
needed to have no reliance on `js`, `js-sys`, `wasm-bindgen`, et al.
(for those who aren't familiar, there are many `wasm` runtimes and not
all of them play nice with `wasm-bindgen`)
This PR simply cleans up the dependencies, and puts them behind optional
flags and whatnot in order to enable this. Both `log` and `tracing` were
being used, so I reduced this only to `tracing`.
End result is limbo can be used like this:
https://github.com/DougAnderson444/wit-limbo
We can open a discussion on the possibilities that running limbo as a
wasm component can offer, including potentially using composable
components to implement the sqlite runtime extensions, as well as giving
us a clean interface for PlatformIO operations -- define them once,
implement many ways on various platforms. I'm new to limbo, but it looks
like current extension are Rust based deps and features flags, whereas
sqlite is runtime, right? What if limbo was runtime extensible too?
The WIT interface is largely sync (though I believe wasmtime has an
async feature), but in my limited exposure to limbo so far a lot of the
wasm seems sync already anyway. Again, topic for further discussion.
Suffice to say, aligning these deps in this way paves the road for
further experiments and possibilities.
Related: https://github.com/neilg63/julian_day_converter/pull/2
Related: https://github.com/tursodatabase/limbo/issues/950
Closes: https://github.com/tursodatabase/limbo/issues/950

Closes #983
2025-02-12 09:24:04 +02:00
Pekka Enberg
cc4ecf43c4 Merge 'extensions/regexp: Add support for regexp_replace()' from lgualtieri75
Reviewed-by: Preston Thorpe (@PThorpe92)

Closes #986
2025-02-12 09:21:52 +02:00
Pekka Enberg
11970d9c0e Merge 'simulator: --differential mode against SQLite' from Alperen Keleş
Closes #987
2025-02-12 09:15:57 +02:00
Pekka Enberg
e48c50faf6 Merge 'cli: Fix infinite loop on non-terminated literal' from Ihor Andrianov
Bug: Infinite loop when parsing unclosed string literal
To reproduce:
Run query: `SELECT max(';`
Current behavior:
- Query runner enters an infinite loop when encountering an unclosed
string literal and prints error
Fix:
- Throw error and stop query runner loop
Closes #988

Closes #989
2025-02-12 09:14:35 +02:00
Pekka Enberg
807446b5fe Merge 'bindings/java: Rename package name tech.turso' from Kim Seon Woo
This PR is to prepare for uploading limbo-jdbc to maven
Refer to this [issue](https://github.com/tursodatabase/limbo/issues/943)

Closes #990
2025-02-12 09:00:58 +02:00
Pekka Enberg
bb8ab4088b github: Update to "ubuntu-22.04" image
Github is removing support for "ubuntu-20.04" soon so let's migrate to a
newer version.
2025-02-12 08:57:30 +02:00
Pekka Enberg
7e3aaaec83 Merge 'cli: Add newline characters on multiline prompts' from Konstantinos Artopoulos
Fixes #980

Closes #985
2025-02-12 08:42:16 +02:00
김선우
14280680c0 Apply rust lint 2025-02-12 10:36:43 +09:00
Ihor Andrianov
c427c46cd2 clippy 2025-02-12 03:35:16 +02:00
김선우
cb7bd3d211 Change package name from org.github.tursodatabase to tech.turso 2025-02-12 09:58:25 +09:00
Ihor Andrianov
287c04bde0 remove repeated code 2025-02-12 02:34:13 +02:00
Ihor Andrianov
a5fcbed21a fix infinite loop error 2025-02-12 00:10:56 +02:00
alpaylan
babf33bafa fix formatting 2025-02-11 14:15:00 -05:00
alpaylan
c133bbdd29 add differential testing against rusqlite 2025-02-11 14:13:14 -05:00
l.gualtieri
6bd40f0507 Add support for REGEXP_REPLACE in limbo extension #740 2025-02-11 20:04:59 +01:00
Konstantinos Artopoulos
16ae7cdc35 fix(cli): add newline characters on multiline prompts 2025-02-11 18:20:35 +02:00
Doug Anderson444
1903914688 add js feature to nodejs build 2025-02-11 12:13:46 -04:00
Pekka Enberg
ebceefacde Merge 'simulator: add NoREC testing property' from Alperen Keleş
NoREC is a correctness property for testing optimizers, proposed by
Rigger and Su in [Detecting Optimization Bugs in Database Engines via
Non-Optimizing Reference Engine
Construction](https://www.manuelrigger.at/preprints/NoREC.pdf)
This PR adds a NoREC property to the tester.

Closes #973
2025-02-11 17:44:56 +02:00