Commit graph

5783 commits

Author SHA1 Message Date
Pekka Enberg
931a33642e Merge 'add interactive transaction to property insert-values-select' from Pere Diaz Bou
Some checks are pending
JavaScript / stable - aarch64-apple-darwin - node@20 (push) Waiting to run
JavaScript / stable - x86_64-apple-darwin - node@20 (push) Waiting to run
JavaScript / stable - x86_64-pc-windows-msvc - node@20 (push) Waiting to run
JavaScript / stable - x86_64-unknown-linux-gnu - node@20 (push) Waiting to run
JavaScript / Test bindings on x86_64-apple-darwin - node@20 (push) Blocked by required conditions
JavaScript / Test bindings on Linux-x64-gnu - node@20 (push) Blocked by required conditions
JavaScript / Build universal macOS binary (push) Blocked by required conditions
JavaScript / Publish (push) Blocked by required conditions
Python / configure-strategy (push) Waiting to run
Python / test (push) Blocked by required conditions
Python / lint (push) Waiting to run
Python / linux (x86_64) (push) Waiting to run
Python / macos-x86_64 (x86_64) (push) Waiting to run
Python / macos-arm64 (aarch64) (push) Waiting to run
Python / sdist (push) Waiting to run
Python / Release (push) Blocked by required conditions
Rust / cargo-fmt-check (push) Waiting to run
Rust / build-native (blacksmith-4vcpu-ubuntu-2404) (push) Waiting to run
Rust / build-wasm (push) Waiting to run
Rust / simulator (push) Waiting to run
Rust / test-limbo (push) Waiting to run
Rust / build-native (macos-latest) (push) Waiting to run
Rust / build-native (windows-latest) (push) Waiting to run
Rust / clippy (push) Waiting to run
Rust / test-sqlite (push) Waiting to run
Rust Benchmarks+Nyrkiö / bench (push) Waiting to run
Rust Benchmarks+Nyrkiö / clickbench (push) Waiting to run
Rust Benchmarks+Nyrkiö / tpc-h-criterion (push) Waiting to run
Rust Benchmarks+Nyrkiö / tpc-h (push) Waiting to run
Rust Benchmarks+Nyrkiö / vfs-bench-compile (push) Waiting to run
Closes #1958
2025-07-07 14:29:02 +03:00
Pekka Enberg
f640298a6e Merge 'add pere to antithesis' from Pere Diaz Bou
Closes #1984
2025-07-07 14:28:24 +03:00
Pekka Enberg
bcfb9df6f5 Merge 'cli: Add support for .headers command' from Pekka Enberg
The `.headers` command takes `on` and `off` as parameter, supported by
SQLite, which controls whether result set header is printed in list
mode.

Closes #1983
2025-07-07 14:28:17 +03:00
Pekka Enberg
3acd0b5097 antithesis: Install procps in Docker image
Having "ps" around is pretty helpful...
2025-07-07 13:58:11 +03:00
Pere Diaz Bou
cae3a9b54e add pere to antithesis 2025-07-07 12:38:21 +02:00
Pekka Enberg
42c08b5bea cli: Add support for .headers command
The `.headers` command takes `on` and `off` as parameter, supported by
SQLite, which controls whether result set header is printed in list mode.
2025-07-07 13:24:45 +03:00
Pekka Enberg
8d844c13da Merge 'stress: add a way to run stress with indexes enabled' from Jussi Saurio
Previously all constraints were disabled with an `if false {}` hack.
In this PR:
- enable PRIMARY KEYs and UNIQUE constraints if `experimental_indexes`
compile-time feature is enabled.
- Also enable PRIMARY KEY for exactly INTEGER columns, as INTEGER
PRIMARY KEY does not require an index
- NOT NULL constraint is also now enabled in both cases, as it doesn't
require an index

Closes #1981
2025-07-07 13:18:10 +03:00
Pekka Enberg
4aa987d65c Merge 'core/translate: Unify no such table error messages' from Pekka Enberg
We're now mixing different error messages, which makes compatibility
testing pretty hard. Unify on a single, SQLite compatible error message
"no such table".

Closes #1978
2025-07-07 13:17:59 +03:00
Jussi Saurio
0762c8f780 stress: add a way to run stress with indexes enabled 2025-07-07 13:04:52 +03:00
Pere Diaz Bou
f7c6d68435 fmt 2025-07-07 08:16:21 +00:00
Pere Diaz Bou
e34058c2d7 clippy 2025-07-07 10:14:40 +02:00
Pekka Enberg
7f91768ff6 core/translate: Unify no such table error messages
We're now mixing different error messages, which makes compatibility
testing pretty hard. Unify on a single, SQLite compatible error message
"no such table".
2025-07-07 11:10:46 +03:00
Pekka Enberg
99a23330a5 testing/glob.test: Run in-memory mode
Let's run the test case with in-memory mode to avoid the (unrelated) WAL
checksum errors that we're hitting.
2025-07-07 11:09:54 +03:00
Pekka Enberg
afa0052921 Merge 'sim: add feature flags (indexes,mvcc) to CLI args' from Jussi Saurio
Closes #1979
2025-07-07 10:58:21 +03:00
Jussi Saurio
ec939eaaa9 sim: add feature flags (indexes,mvcc) to CLI args 2025-07-07 10:27:15 +03:00
Pekka Enberg
34021134fe Fix Antithesis Docker image
Some checks are pending
JavaScript / stable - aarch64-apple-darwin - node@20 (push) Waiting to run
JavaScript / stable - x86_64-apple-darwin - node@20 (push) Waiting to run
JavaScript / stable - x86_64-pc-windows-msvc - node@20 (push) Waiting to run
JavaScript / stable - x86_64-unknown-linux-gnu - node@20 (push) Waiting to run
JavaScript / Test bindings on x86_64-apple-darwin - node@20 (push) Blocked by required conditions
JavaScript / Test bindings on Linux-x64-gnu - node@20 (push) Blocked by required conditions
JavaScript / Build universal macOS binary (push) Blocked by required conditions
JavaScript / Publish (push) Blocked by required conditions
Python / configure-strategy (push) Waiting to run
Python / test (push) Blocked by required conditions
Python / lint (push) Waiting to run
Python / linux (x86_64) (push) Waiting to run
Python / macos-x86_64 (x86_64) (push) Waiting to run
Python / macos-arm64 (aarch64) (push) Waiting to run
Python / sdist (push) Waiting to run
Python / Release (push) Blocked by required conditions
Rust / build-wasm (push) Waiting to run
Rust / simulator (push) Waiting to run
Rust / cargo-fmt-check (push) Waiting to run
Rust / build-native (blacksmith-4vcpu-ubuntu-2404) (push) Waiting to run
Rust / build-native (macos-latest) (push) Waiting to run
Rust / build-native (windows-latest) (push) Waiting to run
Rust / clippy (push) Waiting to run
Rust / test-limbo (push) Waiting to run
Rust / test-sqlite (push) Waiting to run
Rust Benchmarks+Nyrkiö / bench (push) Waiting to run
Rust Benchmarks+Nyrkiö / clickbench (push) Waiting to run
Rust Benchmarks+Nyrkiö / tpc-h-criterion (push) Waiting to run
Rust Benchmarks+Nyrkiö / tpc-h (push) Waiting to run
Rust Benchmarks+Nyrkiö / vfs-bench-compile (push) Waiting to run
2025-07-06 19:19:05 +03:00
Pekka Enberg
eb95ce89d1 Merge 'Fix ScalarFunc::Glob to handle NULL and other value types' from Krishna Vishal
Some checks are pending
JavaScript / stable - aarch64-apple-darwin - node@20 (push) Waiting to run
JavaScript / stable - x86_64-apple-darwin - node@20 (push) Waiting to run
JavaScript / stable - x86_64-pc-windows-msvc - node@20 (push) Waiting to run
JavaScript / stable - x86_64-unknown-linux-gnu - node@20 (push) Waiting to run
JavaScript / Test bindings on x86_64-apple-darwin - node@20 (push) Blocked by required conditions
JavaScript / Test bindings on Linux-x64-gnu - node@20 (push) Blocked by required conditions
JavaScript / Build universal macOS binary (push) Blocked by required conditions
JavaScript / Publish (push) Blocked by required conditions
Python / configure-strategy (push) Waiting to run
Python / Release (push) Blocked by required conditions
Python / test (push) Blocked by required conditions
Python / lint (push) Waiting to run
Python / linux (x86_64) (push) Waiting to run
Python / macos-x86_64 (x86_64) (push) Waiting to run
Python / macos-arm64 (aarch64) (push) Waiting to run
Python / sdist (push) Waiting to run
Rust / cargo-fmt-check (push) Waiting to run
Rust / build-native (blacksmith-4vcpu-ubuntu-2404) (push) Waiting to run
Rust / build-native (macos-latest) (push) Waiting to run
Rust / build-native (windows-latest) (push) Waiting to run
Rust / clippy (push) Waiting to run
Rust / build-wasm (push) Waiting to run
Rust / simulator (push) Waiting to run
Rust / test-limbo (push) Waiting to run
Rust / test-sqlite (push) Waiting to run
Rust Benchmarks+Nyrkiö / bench (push) Waiting to run
Rust Benchmarks+Nyrkiö / clickbench (push) Waiting to run
Rust Benchmarks+Nyrkiö / tpc-h-criterion (push) Waiting to run
Rust Benchmarks+Nyrkiö / tpc-h (push) Waiting to run
Rust Benchmarks+Nyrkiö / vfs-bench-compile (push) Waiting to run
Previously `ScalarFunc::Glob` only handled Text based values. After this
fix it will be able to handle all types of values.
Now:
```SQL
turso> CREATE TABLE IF NOT EXISTS  t0 (c0 REAL );

turso> UPDATE t0 SET c0='C2IS*24', c0=0Xffffffffbfc4330f, c0=0.6463854797956918 WHERE ((((((((t0.c0)AND(t0.c0)))AND(0.23913649834358142)))OR(CASE t0.c0  WHEN t0.c0 THEN 'j2' WHEN t0.c0 THEN t0.c0 WHEN t0.c0 THEN t0.c0 END)))OR(((((((((t0.c0)AND(t0.c0)))AND(t0.c0)))OR(t0.c0)))AND(t0.c0))));

turso> INSERT INTO t0 VALUES (NULL);
INSERT INTO t0 VALUES ('0&');
UPDATE t0 SET c0=2352448 WHERE ((((t0.c0)GLOB(t0.c0))) NOT NULL);
turso> SELECT * from t0;
┌───────────┐
│ c0        │
├───────────┤
│           │
├───────────┤
│ 2352448.0 │
└───────────┘
```
Fixes: https://github.com/tursodatabase/turso/issues/1953

Closes #1955
2025-07-06 10:51:54 +03:00
Krishna Vishal
f322ab7ab3 Add regression test 2025-07-06 13:18:21 +05:30
Krishna Vishal
fc8403991b Fix Glob ScalarFunc to handle NULL and other Value types.
Fixes: https://github.com/tursodatabase/turso/issues/1953
2025-07-06 13:18:21 +05:30
Pekka Enberg
169af0a23e Remove .editorconfig file 2025-07-06 10:44:49 +03:00
Pekka Enberg
5dfbe8db08 Merge 'bindings/java: Merge JavaScript test suites' from Mikaël Francoeur
I modified the `better-sqlite3.spec.mjs` test suite to use the dual test
runner from https://github.com/tursodatabase/turso/pull/1941 and I
deleted the `limbo.spec.mjs` test suite, because it's now redundant.
I looked carefully at the diff between the two test suites to make sure
that we didn't lose any coverage with this change.

Closes #1959
2025-07-06 10:44:35 +03:00
Pekka Enberg
bbf938041b Fix example in README.md
We currently have indexing disabled by default, which means non-rowid
primary keys are disabled too.

Fixs #1961
2025-07-06 10:37:49 +03:00
Pekka Enberg
a833f9e33a Merge 'Add multi select test in JDBC4StatementTest' from Kim Seon Woo
In reponse to [discord discussion](https://discord.com/channels/12586588
26257961020/1385754749634084885/1390535068401012858), I thought it would
be better to add a test to show how JDBC4Statement can be used.

Closes #1962
2025-07-06 10:15:15 +03:00
김선우
c8bb2e73ec Add multi select test in JDBC4StatementTest 2025-07-05 09:36:27 +09:00
Mikaël Francoeur
38c650380c fix nvim messup 2025-07-04 11:19:27 -04:00
Mikaël Francoeur
d8d26463db add new test 2025-07-04 11:18:47 -04:00
Mikaël Francoeur
4b1fdc457d fix typo 2025-07-04 11:17:24 -04:00
Mikaël Francoeur
a427751e3a merge js binding test suites 2025-07-04 10:13:05 -04:00
Pere Diaz Bou
897f13c173 add interactive transaction to property insert-values-select 2025-07-04 15:50:46 +02:00
Pekka Enberg
c28c83fa2c Fix formatting in Cargo.toml
Some checks failed
Run long fuzz tests on Btree / run-long-tests (push) Has been cancelled
Run long fuzz tests on Btree / simple-stress-test (push) Has been cancelled
JavaScript / stable - aarch64-apple-darwin - node@20 (push) Has been cancelled
JavaScript / stable - x86_64-apple-darwin - node@20 (push) Has been cancelled
JavaScript / stable - x86_64-pc-windows-msvc - node@20 (push) Has been cancelled
JavaScript / stable - x86_64-unknown-linux-gnu - node@20 (push) Has been cancelled
Python / configure-strategy (push) Has been cancelled
Python / linux (x86_64) (push) Has been cancelled
Python / macos-x86_64 (x86_64) (push) Has been cancelled
Python / macos-arm64 (aarch64) (push) Has been cancelled
Python / sdist (push) Has been cancelled
Rust / build-native (blacksmith-4vcpu-ubuntu-2404) (push) Has been cancelled
Rust / build-native (macos-latest) (push) Has been cancelled
Rust / build-native (windows-latest) (push) Has been cancelled
Rust / clippy (push) Has been cancelled
Rust / build-wasm (push) Has been cancelled
Rust / simulator (push) Has been cancelled
Rust / test-limbo (push) Has been cancelled
Rust / test-sqlite (push) Has been cancelled
Rust Benchmarks+Nyrkiö / bench (push) Has been cancelled
Rust Benchmarks+Nyrkiö / clickbench (push) Has been cancelled
Rust Benchmarks+Nyrkiö / tpc-h-criterion (push) Has been cancelled
Rust Benchmarks+Nyrkiö / tpc-h (push) Has been cancelled
Rust Benchmarks+Nyrkiö / vfs-bench-compile (push) Has been cancelled
JavaScript / Test bindings on x86_64-apple-darwin - node@20 (push) Has been cancelled
JavaScript / Test bindings on Linux-x64-gnu - node@20 (push) Has been cancelled
JavaScript / Build universal macOS binary (push) Has been cancelled
JavaScript / Publish (push) Has been cancelled
Python / test (push) Has been cancelled
Python / Release (push) Has been cancelled
2025-07-04 12:54:58 +03:00
Pekka Enberg
b9bba101d4 Rename limbo_stress to turso_stress 2025-07-04 12:53:58 +03:00
Pekka Enberg
6e79a11dc7 Merge 'bindings/dart initial implementation' from Andika Tanuwijaya
re-upload

Closes #1911
2025-07-04 10:43:19 +03:00
Pekka Enberg
38c6183adf Merge 'bindings/javascript: Implement Database.open' from Lucas Forato
Reviewed-by: Diego Reis (@el-yawd)

Closes #1834
2025-07-04 10:28:50 +03:00
Pekka Enberg
793fa495e8 Merge 'Import JavaScript bindings test suite from libSQL' from Mikaël Francoeur
This PR imports the `sync` test suite from libSQL, and modifies the
export structure match `better-sqlite3`, so that at least a few tests
from the new test suite are passing.
I also changed the `package.json` to expose `wrapper.js` as an
entrypoint. I think the plain `index.js` was probably never meant to be
exposed directly to clients, because the wrapper does some important
transformation. It's also how libSQL-js is
[structured](https://github.com/tursodatabase/libsql-
js/blob/main/package.json#L20).
## DualTest test runner
The test suite that I imported was previously run twice, with different
environment variables: one run for libSQL-js, one run for better-
sqlite3. This worked well with libSQL, because it's compatible with
better-sqlite3. But Turso isn't there yet, so even though all tests need
to run on better-sqlite3, not all tests are passing on Turso.
To make it possible to run the test suite on both implementation, and to
make it possible to track the progress of Turso, I've added a `DualTest`
test runner that emulates the API of the Ava test runner, but instead of
a single `test()` function, it exposes two methods: `both()`, and
`onlySqlitePasses()`. The first one runs the test on both
implementations, and the second one also runs it on both, but expects
that Turso will fail.
When Turso is completely compatible with better-sqlite3, it will be easy
to remove the dual-test runner, since it has the same API as Ava.
## Future development
### Existing tests
The existing tests were divided in two files: `better-sqlite3.spec.mjs`,
and `dual-test.mjs` that are kept in sync manually. The first one is
mostly a superset of the second one, with additional tests indicating
behaviour that isn't implemented in Turso yet. I want to merge these
test suites to also use the dual-test test runner. This will make it
easier to evolve test suites and to track the progress of Turso.
### `SqliteError`
Modifying the test called `errors` to `both()` will show that Turso is
still missing an `SqliteError` type, to be compatible with better-
sqlite3. I have the required changes in a stash and will open a PR
shortly.
-----
as part of https://github.com/tursodatabase/turso/issues/1900

Closes #1941
2025-07-04 10:26:58 +03:00
Pekka Enberg
16a7416d0e cargo dist: s/limbo/turso/ 2025-07-04 10:13:50 +03:00
Pekka Enberg
f46bd6f40d Merge 'bindings/java: Rename to Turso' from Diego Reis
Closes #1936
2025-07-04 10:06:19 +03:00
Pekka Enberg
97ea4f1a80 Merge 'add libsql_disable_wal_checkpoint' from Pedro Muniz
Closes #1894

Closes #1920
2025-07-04 10:04:00 +03:00
Pekka Enberg
6a2404a3ff Merge 'Add a threshold for large page cache values' from Krishna Vishal
Added a threshold to clip input page cache size values to `0`. This
avoid the panic at runtime and also follow's SQLite behavior closely.
Now:
```
Turso v0.1.1
Enter ".help" for usage hints.
This software is ALPHA, only use for development, testing, and experimentation.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database
turso> PRAGMA main.cache_size = 5022422913188235998;
turso> PRAGMA main.cache_size;
┌────────────┐
│ cache_size │
├────────────┤
│         10 │
└────────────┘
```
Closes: https://github.com/tursodatabase/turso/issues/1952

Closes #1954
2025-07-04 10:01:06 +03:00
Krishna Vishal
19d949521a Add a threshold to clip large page cache values to 0. This prevents
panic at runtime.
2025-07-04 10:24:10 +05:30
Mikaël Francoeur
50d542b719 expose wrapper and use default import 2025-07-03 15:19:03 -04:00
Mikaël Francoeur
6faa81034c add and adapt test suite from libsql 2025-07-03 15:19:03 -04:00
Pekka Enberg
1aad782271 Merge 'Antithesis schema rollback tests' from Pekka Enberg
Some checks are pending
JavaScript / stable - aarch64-apple-darwin - node@20 (push) Waiting to run
JavaScript / stable - x86_64-apple-darwin - node@20 (push) Waiting to run
JavaScript / stable - x86_64-pc-windows-msvc - node@20 (push) Waiting to run
JavaScript / stable - x86_64-unknown-linux-gnu - node@20 (push) Waiting to run
JavaScript / Test bindings on x86_64-apple-darwin - node@20 (push) Blocked by required conditions
JavaScript / Test bindings on Linux-x64-gnu - node@20 (push) Blocked by required conditions
JavaScript / Build universal macOS binary (push) Blocked by required conditions
JavaScript / Publish (push) Blocked by required conditions
Python / test (push) Blocked by required conditions
Python / lint (push) Waiting to run
Python / configure-strategy (push) Waiting to run
Python / linux (x86_64) (push) Waiting to run
Python / macos-x86_64 (x86_64) (push) Waiting to run
Python / macos-arm64 (aarch64) (push) Waiting to run
Python / sdist (push) Waiting to run
Python / Release (push) Blocked by required conditions
Rust / cargo-fmt-check (push) Waiting to run
Rust / build-native (blacksmith-4vcpu-ubuntu-2404) (push) Waiting to run
Rust / build-native (macos-latest) (push) Waiting to run
Rust / build-native (windows-latest) (push) Waiting to run
Rust / clippy (push) Waiting to run
Rust / build-wasm (push) Waiting to run
Rust / simulator (push) Waiting to run
Rust / test-limbo (push) Waiting to run
Rust / test-sqlite (push) Waiting to run
Rust Benchmarks+Nyrkiö / vfs-bench-compile (push) Waiting to run
Rust Benchmarks+Nyrkiö / bench (push) Waiting to run
Rust Benchmarks+Nyrkiö / clickbench (push) Waiting to run
Rust Benchmarks+Nyrkiö / tpc-h-criterion (push) Waiting to run
Rust Benchmarks+Nyrkiö / tpc-h (push) Waiting to run
Closes #1940
2025-07-03 21:28:17 +03:00
Pekka Enberg
c3e8bfab34 Merge 'Disable adaptive colors when output_mode is list' from meteorgan
As adaptive colors use `OSC 11` to query the terminal's background
color,  the query string may contaminate test result and cause failures
when running tests in a terminal.
```
 make test-vector

SQLITE_EXEC=scripts/limbo-sqlite3 ./testing/vector.test
(testing/testing.db)                        Running test: vector-functions-valid
Test FAILED: SELECT vector_extract(vector('[]'));
  SELECT vector_extract(vector('  [  1  ,  2  ,  3  ]  '));
  SELECT vector_extract(vector('[-1000000000000000000]'));
returned '[]
[1,2,3]
[-1000000000000000000]'
expected '[]
[1,2,3]
[-1000000000000000000]'
^[]11;rgb:158e/193a/1e75^[\make: *** [test-vector] Error 1
```

Closes #1942
2025-07-03 19:35:05 +03:00
Pekka Enberg
82a727bcf2 antithesis: Fix Python linter complaints in parallel_driver_schema_rollback.py 2025-07-03 19:34:23 +03:00
meteorgan
ccfee3f418 disable adaptive colors when output_mode is list 2025-07-03 23:31:51 +08:00
pedrocarlo
56d87cb916 move disable behavior to connection instead of checkpoint 2025-07-03 12:05:53 -03:00
pedrocarlo
3861584edc add test for wal checkpointing correctly 2025-07-03 12:04:17 -03:00
pedrocarlo
44b8275b26 add test + implement sqlite3_column_int64 for test 2025-07-03 12:04:17 -03:00
pedrocarlo
db005c81a0 add option to disable wal checkpoint 2025-07-03 12:04:17 -03:00
Diego Reis
4b32577f80 bind/java: Rename to Turso 2025-07-03 10:56:05 -03:00