Commit graph

291 commits

Author SHA1 Message Date
PThorpe92
787e1f5d84
use new syntax for simulator in github action 2025-12-17 17:23:09 -05:00
PThorpe92
a9842d1116
Add simulator run with io_uring io backend to github action 2025-12-17 17:22:41 -05:00
Jussi Saurio
eb59bc6ae6 Merge 'Enable MVCC with PRAGMA journal_mode' from Pedro Muniz
Some checks are pending
Build & publish @tursodatabase/database / db-bindings-x86_64-pc-windows-msvc - node@20 (push) Waiting to run
Build & publish @tursodatabase/database / db-bindings-x86_64-unknown-linux-gnu - node@20 (push) Waiting to run
Build & publish @tursodatabase/database / sync-bindings-aarch64-apple-darwin - node@20 (push) Waiting to run
Build & publish @tursodatabase/database / sync-bindings-aarch64-unknown-linux-gnu - node@20 (push) Waiting to run
Build & publish @tursodatabase/database / sync-bindings-wasm32-wasip1-threads - node@20 (push) Waiting to run
Build & publish @tursodatabase/database / sync-bindings-x86_64-pc-windows-msvc - node@20 (push) Waiting to run
Build & publish @tursodatabase/database / sync-bindings-x86_64-unknown-linux-gnu - node@20 (push) Waiting to run
Build & publish @tursodatabase/database / Test DB bindings on Linux-x64-gnu - node@20 (push) Blocked by required conditions
Build & publish @tursodatabase/database / Test DB bindings on browser@20 (push) Blocked by required conditions
Build & publish @tursodatabase/database / 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-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 / 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 #3536
# Description
This PR implements **dynamic journal mode switching** via `PRAGMA
journal_mode`, allowing users to switch between WAL and MVCC modes at
runtime.
### Key Changes
**Core Feature: Journal Mode Switching**
- Added new `JournalMode` module (`core/storage/journal_mode.rs`) to
parse and handle journal mode transitions
- Modified `op_journal_mode` to correctly parse journal modes and update
the database header
- Emit checkpoint when setting a new journal mode to ensure data
consistency
- Added MVCC checkpoint support to `Connection::checkpoint`
**Database Initialization Improvements**
- Read DB header on `Database::open` and simplified `init_pager`
- Made `Version` an enum for better comparison semantics
- Automatically convert legacy SQLite databases to WAL mode
- Ensure DB header is flushed to disk when header changes during open
- Clear page cache after header validation
**Bug Fixes**
- Fixed dirty page invalidation in pager when clearing dirty pages in
page cache
- Fixed `is_none_or` check for row version existence in DB file (handles
MvStore initialization and empty database cases)
- Added `btree_resident` field in `RowVersion` to track if
insert/deletion originated from a btree
**Testing**
- Added fuzz tests for `journal_mode` transitions with Database
operations in between
- Added integration tests for testing switching from the different modes
while checking the header version is correct
- Added some specific regression tests for delete operations lost on
mode switch
- Fixed `index_scan_compound_key_fuzz` to use separate databases for
Turso and SQLite in MVCC mode. Also had to decrease number of rows for
MVCC test, as insert was very slow.
# TODO's
- Remove sync hacks from `op_journal_mode`
- Expand fuzzer with different queries
- Add to Simulator
- Special handling for read only databases and not allow any header
changes
# Motivation and context
Facilitate our users to test MVCC and transition back and forth from it.
# AI Disclosure
Used AI to catch and fix bugs in MVCC, further my understanding with
MVCC, write tests in `tests` folder, most of the PR summary, and the
docs in the `docs/manual.md` file

Reviewed-by: Jussi Saurio <jussi.saurio@gmail.com>

Closes #4074
2025-12-17 21:03:56 +02:00
PThorpe92
db60db7d9b
impl cache spilling in pager 2025-12-17 11:57:34 -05:00
Pekka Enberg
fcfcc04550
Merge 'Add dotnet bindings to Turso' from Kopylov Dmitriy
Added C#/dotnet bindings for turso

Reviewed-by: Nikita Sivukhin (@sivukhin)

Closes #3594
2025-12-17 16:45:55 +02:00
pedrocarlo
18b810bb04 adjust cli to Print warnings + print a warning about not converting to MVCC mode with WAL file 2025-12-17 10:55:25 -03:00
Nikita Sivukhin
9f7c0dcfdd fix go workflow 2025-12-15 11:52:19 +04:00
Nikita Sivukhin
e049235820 npm pack instead of --dry-run 2025-12-12 19:47:12 +04:00
Jussi Saurio
0887ebef7d Merge 'ci: run TCL tests for MVCC under CI' from Pere Diaz Bou
Some checks are pending
Build & publish @tursodatabase/database / db-bindings-x86_64-pc-windows-msvc - node@20 (push) Waiting to run
Build & publish @tursodatabase/database / db-bindings-x86_64-unknown-linux-gnu - node@20 (push) Waiting to run
Build & publish @tursodatabase/database / sync-bindings-aarch64-apple-darwin - node@20 (push) Waiting to run
Build & publish @tursodatabase/database / sync-bindings-aarch64-unknown-linux-gnu - node@20 (push) Waiting to run
Build & publish @tursodatabase/database / sync-bindings-wasm32-wasip1-threads - node@20 (push) Waiting to run
Build & publish @tursodatabase/database / sync-bindings-x86_64-pc-windows-msvc - node@20 (push) Waiting to run
Build & publish @tursodatabase/database / sync-bindings-x86_64-unknown-linux-gnu - node@20 (push) Waiting to run
Build & publish @tursodatabase/database / Test DB bindings on Linux-x64-gnu - node@20 (push) Blocked by required conditions
Build & publish @tursodatabase/database / Test DB bindings on browser@20 (push) Blocked by required conditions
Build & publish @tursodatabase/database / 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-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 / 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
## Description
Run TCL tests for MVCC in the CI. Right now almost everything is
commented out as we need to fix them.
## AI Disclosure
No
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Adds CI step to run MVCC TCL tests via a custom sqlite wrapper with
experimental flags, and narrows the MVCC test suite to known passing
tests.
>
> - **CI**:
>   - Add `Test mvcc` step in `test-limbo` job to run `make test-compat-
mvcc` in `.github/workflows/rust.yml`.
> - **Makefile**:
>   - Update `test-compat-mvcc` to use `SQLITE_EXEC=scripts/turso-mvcc-
sqlite3`.
> - **Test Runner Script** (`scripts/turso-mvcc-sqlite3`):
>   - Enable experimental flags: `--experimental-mvcc`, `--experimental-
views`, `--experimental-strict`.
> - **Tests**:
>   - Define `testing/all-mvcc.test` with a subset of passing test
files; comment out failing ones.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
ee48302e30. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

Reviewed-by: Jussi Saurio <jussi.saurio@gmail.com>

Closes #4178
2025-12-11 23:39:05 +02:00
Preston Thorpe
73289c6325
Merge 'Go driver' from Nikita Sivukhin
This PR brings back go driver to the turso monorepo and adds sync
support for the golang.
It depends on the pre-compiled binaries at
https://github.com/tursodatabase/turso-go-platform-libs repository
There is a CI which trigger build on the turso-go-platform-libs repo in
case when release tag is published

Reviewed-by: Preston Thorpe <preston@turso.tech>

Closes #4085
2025-12-11 09:52:15 -05:00
Pekka Enberg
963526c71c Use npm 11 for OIDC trusted publishing support
npm trusted publishing requires npm 11.5.1+, but Node 20 ships with
npm 10.x. Also remove registry-url which was causing token-based auth
to be attempted instead of OIDC.
2025-12-11 14:33:18 +02:00
Nikita Sivukhin
ef2237e6bc fix changes for testing in ci 2025-12-11 16:14:52 +04:00
Pekka Enberg
eb64f546dc Switch npm publishing to use the official setup-node action
The useblacksmith/setup-node@v5 fork is archived and doesn't properly
support npm OIDC trusted publishing. Switch the publish job to use
actions/setup-node@v4 which correctly configures .npmrc for OIDC
authentication.
2025-12-11 13:33:12 +02:00
Pere Diaz Bou
ee48302e30 make: move SQLITE_EXEC to test-compat-mvcc 2025-12-11 12:08:55 +01:00
Pere Diaz Bou
d66e6a2aac ci: SQLITE_EXEC=scripts/turso-mvcc-sqlite3 2025-12-11 12:05:05 +01:00
Nikita Sivukhin
5c5765d91e fix ci 2025-12-11 15:03:03 +04:00
Pere Diaz Bou
e048a48bee ci: run TCL tests for MVCC under CI 2025-12-11 11:57:32 +01:00
Pekka Enberg
865afb3e65 Switch npm publishing to OIDC trusted publishing
Remove NPM_TOKEN-based authentication in favor of npm's new OIDC
trusted publishing. This eliminates the need for long-lived tokens
and improves security.

Changes:

- Add registry-url to setup-node configuration as recommended by
  GitHub's documentation for npm provenance publishing. This ensures
  npm knows the target registry and creates consistent .npmrc setup.
- Remove NPM_TOKEN from .npmrc injection
- Use --provenance flag directly on npm publish
- Remove NPM_TOKEN and GITHUB_TOKEN env vars
- The workflow already had the required "id-token: write" permission.
2025-12-11 12:57:28 +02:00
Nikita Sivukhin
fbc4be6c81 fix go ci 2025-12-11 14:43:17 +04:00
Nikita Sivukhin
cf58c3197f fix ci 2025-12-11 12:58:30 +04:00
Nikita Sivukhin
93b613da71 temp CI changes 2025-12-11 12:08:24 +04:00
Nikita Sivukhin
511781ef3a fix go ci 2025-12-11 11:47:47 +04:00
Nikita Sivukhin
3a7fd608ee add publish steps 2025-12-11 11:27:49 +04:00
Nikita Sivukhin
3b393e3623 add simple ci for go driver 2025-12-10 23:03:16 +04:00
Nikita Sivukhin
ceb754b3b8 dist init
- upgrade cargo dist to 0.30.2 in order to use macos-15-intel as macos-13 runners were deprecated by Github
- https://github.com/axodotdev/cargo-dist/issues/2167
- https://github.com/axodotdev/cargo-dist/releases/tag/v0.30.1
2025-12-10 17:29:07 +04:00
Nikita Sivukhin
88f8ee96b1 adjust github ci 2025-12-09 15:42:29 +04:00
Jussi Saurio
cc835096d6 CI: simulator tweaks
- Run sims with external for loops (instead of --loop flag in sim) so that each iteration gets a separate seed.
This produces much easier-to-debug traces when there's a failure since we don't have to potentially run 10 iterations
of the same seed to get to the failure.
- Run with memory-io because it's 1. faster and 2. introduces async IO latency unlike our normal synchronous IO
  backend.
2025-12-08 10:52:40 +02:00
Dmitriy
24e388bd72 Fix ci publish 2025-12-03 12:23:11 +04:00
Dmitriy
510e440899 Fix github actions 2025-12-03 12:23:11 +04:00
Dmitriy
e4d93c4ef9 Add dotnet test workflow 2025-12-03 12:23:11 +04:00
Dmitriy
aafa41dd4c Add publish workflow 2025-12-03 12:23:11 +04:00
Nikita Sivukhin
283ffd998b disable sync tests for now - because they need turso server 2025-12-02 17:22:59 +04:00
Henrik Ingo
dd25599529 Set all comment-on to false 2025-11-13 01:16:09 +02:00
Pekka Enberg
d872237ca8
Merge 'workflows: Add GITHUB_TOKEN to all Nyrkiö steps' from Henrik Ingo
Some checks are pending
Rust / simulator (push) Waiting to run
Build & publish @tursodatabase/database / db-bindings-wasm32-wasip1-threads - node@20 (push) Waiting to run
Build & publish @tursodatabase/database / db-bindings-x86_64-unknown-linux-gnu - node@20 (push) Waiting to run
Build & publish @tursodatabase/database / sync-bindings-aarch64-apple-darwin - node@20 (push) Waiting to run
Build & publish @tursodatabase/database / sync-bindings-aarch64-unknown-linux-gnu - node@20 (push) Waiting to run
Build & publish @tursodatabase/database / sync-bindings-wasm32-wasip1-threads - node@20 (push) Waiting to run
Build & publish @tursodatabase/database / Publish (push) Blocked by required conditions
Build & publish @tursodatabase/database / sync-bindings-x86_64-pc-windows-msvc - node@20 (push) Waiting to run
Build & publish @tursodatabase/database / sync-bindings-x86_64-unknown-linux-gnu - node@20 (push) Waiting to run
Build & publish @tursodatabase/database / Test DB bindings on Linux-x64-gnu - node@20 (push) Blocked by required conditions
Build & publish @tursodatabase/database / Test DB bindings on browser@20 (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-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 / 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ö / tpc-h (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
Previously we didn't use GITHUB_TOKEN for anything. But now that PR
meta-data must be fetched with a extra GitHub API call, then PRs at
least will always nedd GITHUB_TOKEN.

Closes #3918
2025-11-10 09:03:38 +02:00
Pekka Enberg
36c3489c53 github: Make Nyrkiö comment less
We're getting tons of false positives in PRs so let's make Nyrkiö less
verbose.
2025-11-08 10:03:22 +02:00
Henrik Ingo
39f787d531 workflows: Add GITHUB_TOKEN to all Nyrkiö steps
Previously we didn't use GITHUB_TOKEN for anything.
But now that PR meta-data must be fetched with a extra
GitHub API call, then PRs at least will always nedd GITHUB_TOKEN.
2025-11-05 18:13:49 +02:00
Pekka Enberg
d71a33a188 antithesis: Upload config image in GitHub Actions workflow
The Antithesis config image was not being uploaded during CI runs, only
the workload image. This caused experiment failures when the config
image expired from the registry after 6 months of inactivity.
2025-10-30 07:49:44 +02:00
Henrik Ingo
54a9821bcf Tighten Nyrkio p-value to 0.00001
This will produce even less alerts than so far, but still catches
actual changes in performance.
2025-10-27 07:09:02 +02:00
Pekka Enberg
da828681c3 github: Run fuzz tests in a separate workflow 2025-10-22 13:13:59 +03:00
Henrik Ingo
00bde0d52a Nyrkiö nightly: Reduce frequency to 1 per 24h
Also fix a missed path in sqlite3 tests
2025-10-12 13:46:26 +03:00
Pekka Enberg
12783ef01e
Merge 'bindings/java: Add support for publishing to Maven Central' from Kim Seon Woo
Some checks are pending
Build & publish @tursodatabase/database / db-bindings-x86_64-pc-windows-msvc - node@20 (push) Waiting to run
Build & publish @tursodatabase/database / db-bindings-x86_64-unknown-linux-gnu - node@20 (push) Waiting to run
Build & publish @tursodatabase/database / sync-bindings-aarch64-apple-darwin - node@20 (push) Waiting to run
Build & publish @tursodatabase/database / sync-bindings-aarch64-unknown-linux-gnu - node@20 (push) Waiting to run
Build & publish @tursodatabase/database / sync-bindings-wasm32-wasip1-threads - node@20 (push) Waiting to run
Build & publish @tursodatabase/database / sync-bindings-x86_64-pc-windows-msvc - node@20 (push) Waiting to run
Build & publish @tursodatabase/database / sync-bindings-x86_64-unknown-linux-gnu - node@20 (push) Waiting to run
Build & publish @tursodatabase/database / Test DB bindings on Linux-x64-gnu - node@20 (push) Blocked by required conditions
Build & publish @tursodatabase/database / Test DB bindings on browser@20 (push) Blocked by required conditions
Build & publish @tursodatabase/database / 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-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 / 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
## Purpose
- Deploy `tech.turso:turso:<version>` to maven central so that users can
easily use java bindings
  - For example :
https://repo1.maven.org/maven2/io/github/seonwkim/turso/0.0.1/
## Requirements
- [x] Add the following github secrets.
  - [x] MAVEN_CENTRAL_USERNAME
  - [x] MAVEN_CENTRAL_PASSWORD
  - [x] GPG_PRIVATE_KEY
  - [x] GPG_PASSPHRASE
- [ ] Namespace `tech.turso` must be registered at maven central
- [ ] GPG key registration to key servers
- Notes
  - Retrieve MAVEN_CENTRAL_USERNAME and MAVEN_CENTRAL_PASSWORD from
[maven central](https://central.sonatype.com/usertoken)
  - GPG keys should be registered. You should distribute your keys to
designated(maven central supported) servers
    -  Refer to [GPG key related docs](https://central.sonatype.org/publ
ish/requirements/gpg/#distributing-your-public-key)
    - Btw, I used `keyserver.ubuntu.com` key server while testing
### [Maven Central Username &
Password](https://central.sonatype.com/usertoken)
<img width="2878" height="1338" alt="image"
src="https://github.com/user-
attachments/assets/03e6f967-a7f6-46b8-aef5-d15772bd9eea" />
### [Maven Central
Namespace](https://central.sonatype.com/publishing/namespaces)
<img width="1424" height="456" alt="image" src="https://github.com/user-
attachments/assets/8c0f4f17-bf5a-4c6a-bc47-748d86cd1f1a" />
## Future Works
- Currently, we depend on gradle.properties to determine the version of
our dependency and it's cumbersome to always change the version
manually. Let's find a better solution.

Closes #3624
2025-10-10 13:12:01 +03:00
Kim Seon Woo
722c906ca6 Change variable names 2025-10-08 15:43:27 +09:00
Henrik Ingo
223b060a6a Increase instance size to avoid OOM 2025-10-07 23:26:19 +03:00
Kim Seon Woo
c149f65b91 Add java-publish.yml workflow 2025-10-07 23:38:07 +09:00
Henrik Ingo
e5c44cced0 fix: perf_nightly YAML syntax 2025-10-07 15:53:17 +03:00
Henrik Ingo
24438f7e4e Fix: perf_nightly.yml YAML syntax 2025-10-07 15:51:34 +03:00
Henrik Ingo
f977c5f0a4 Add Nightly versions of benchmarks that run on Nyrkiö runners 2025-10-07 15:38:04 +03:00
Jussi Saurio
653f9323c3
Update .github/workflows/long_fuzz_tests_btree.yml
Co-authored-by: Pere Diaz Bou <30913090+pereman2@users.noreply.github.com>
2025-10-03 11:18:09 +03:00
Jussi Saurio
509486bc05 CI: run long fuzz tests and stress on every PR, use 2 threads for stress 2025-10-03 11:12:01 +03:00
PThorpe92
a35f8a427f
Allow workflow_dispatch for all CI to allow for re-running individual jobs 2025-10-01 19:01:10 -04:00