Commit Graph

7435 Commits

Author SHA1 Message Date
PThorpe92
d2df8bf1a3 Update PERF.md 2025-08-11 19:44:12 -04:00
Jussi Saurio
909c096579 Merge 'docs: improve README initialization section clarity' from Braden Wong
Improves the clarity of the README's "Getting Started" → "Command Line"
section by adding explicit `$ tursodb` command example so users know
exactly what to type.

Closes #2534
2025-08-11 21:11:01 +03:00
Jussi Saurio
f598c86fa4 Merge 'Handle single, double and unquoted strings in values clause' from Mikaël Francoeur
I'm not sure how much this will clash with @TcMits's parser rewrite,
hopefully not too much. If it does and we eventually have to remove it,
at least we'll have two new regression tests.
Closes https://github.com/tursodatabase/turso/issues/2484

Closes #2499
2025-08-11 21:08:15 +03:00
Jussi Saurio
a7c1c8b7d4 Merge 'Use rusqlite 0.37 with bundled SQLite everywhere' from Jussi Saurio
Use the same rusqlite version in every crate and use a bundled up-to-
date sqlite version
(the impetus for this PR is still me trying to figure out why sqlite in
the insert benchmark doesn't seem to be fsyncing, even when instructed)

Closes #2507
2025-08-11 21:07:24 +03:00
Preston Thorpe
cb59877821 Merge 'Feat/pragma module list' from Lucas Forato
Implementation of the module_list pragma

Reviewed-by: Diego Reis (@el-yawd)
Reviewed-by: Preston Thorpe <preston@turso.tech>

Closes #2430
2025-08-11 13:54:24 -04:00
PThorpe92
4dbf69545e try_borrow.unwrap -> borrow 2025-08-11 13:54:00 -04:00
Braden Wong
51d2824b6e fix: tursodb insteada of turso for shell command in README 2025-08-11 12:17:33 -04:00
Braden Wong
5751fb6d4c Merge branch 'tursodatabase:main' into improve-readme-initialization 2025-08-11 09:17:07 -07:00
PThorpe92
ae22af29cd Fix pragma module list tests 2025-08-11 12:13:47 -04:00
Lucas Forato
e07ab423e6 feat: removed module_name from VirtualTable, instead looking only at symbol tables 2025-08-11 11:43:32 -03:00
Pekka Enberg
9ae6a57980 Merge 'remove turso-sync as now we have turso-sync-engine' from Nikita Sivukhin
Reviewed-by: Jussi Saurio <jussi.saurio@gmail.com>

Closes #2539
2025-08-11 17:00:13 +03:00
Pekka Enberg
9a35d76c55 Merge 'Add support for Full checkpoint mode in the WAL' from Preston Thorpe
Closes #2519

Closes #2521
2025-08-11 16:59:26 +03:00
Nikita Sivukhin
eb40d4aff6 remove turso-sync as now we have turso-sync-engine 2025-08-11 16:53:39 +04:00
Jussi Saurio
ec7bded092 Merge 'Sorter IO Completions' from Pedro Muniz
Convert Sorter code to use state machines and not ignore completions.
Also simplifies some logic that seemed redundant to me. Also, I was
getting some IO errors because we were opening one file per Chunk, so I
fixed this by using only one file per sorter, and just using offsets in
the file for each chunk.
Builds on top of #2520

Closes #2473
2025-08-11 15:42:58 +03:00
Jussi Saurio
c25e8c685d let fuzz still have its own workspace 2025-08-11 15:13:58 +03:00
Jussi Saurio
87bf488bbc chore: use rusqlite 0.37 with bundled sqlite everywhere 2025-08-11 15:13:57 +03:00
Pekka Enberg
909338fad1 Merge 'Simulator should delete files after a successful run' from Pedro Muniz
I was getting IO errors for too many files when running the simulator
locally. It seemed that the simulator did not delete files after a
successful run. After this change, I did not get anymore errors

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

Closes #2520
2025-08-11 15:09:32 +03:00
Pekka Enberg
221e030d98 Merge 'Fix performance regression in prepare' from Piotr Rżysko
Attempt at fixing https://github.com/tursodatabase/turso/issues/2527.

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

Closes #2532
2025-08-11 15:08:10 +03:00
Pekka Enberg
4a53c44466 Merge 'Add support for PRAGMA freelist_count' from bit-aloo
Implements `PRAGMA freelist_count` to return the current number of free
pages in the database.

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

Closes #2531
2025-08-11 15:07:58 +03:00
Lucas Forato
9fe20a178a fix: formatting 2025-08-11 09:01:27 -03:00
Lucas Forato
76838bb46a fix: issues from rebase 2025-08-11 08:54:42 -03:00
Lucas Forato
562076fdb8 fix: close method 2025-08-11 08:42:19 -03:00
Lucas Forato
673cfdbc0f test: include tests in extensions.py 2025-08-11 08:42:08 -03:00
Lucas Forato
19c445f8b1 feat: listing both used and non-used modules 2025-08-11 08:42:08 -03:00
Lucas Forato
c2a5b43c68 fix: revert changes on testing dbs 2025-08-11 08:42:08 -03:00
Lucas Forato
adb69f21f9 feat: remove mods 2025-08-11 08:42:08 -03:00
Lucas Forato
8b1b79bc93 fix: broken file after merge 2025-08-11 08:42:08 -03:00
Lucas Forato
4161f68774 Update core/lib.rs
Co-authored-by: bit-aloo <84662239+Shourya742@users.noreply.github.com>
2025-08-11 08:42:03 -03:00
Lucas Forato
804df8dd7a feat: changed to non-empty test 2025-08-11 08:42:03 -03:00
Lucas Forato
c37ccd49e1 feat: included tests 2025-08-11 08:42:03 -03:00
Lucas Forato
6b1ae89426 chore: remove todo comment 2025-08-11 08:42:03 -03:00
Lucas Forato
27fd6aa13a chore: updated comment 2025-08-11 08:42:03 -03:00
Lucas Forato
5aa99f6743 feat: listing all modules 2025-08-11 08:42:03 -03:00
Lucas Forato
ff157e10e5 feat: included ModuleList in PragmaName 2025-08-11 08:41:53 -03:00
Pekka Enberg
08ab998404 Merge 'Initial pass on incremental view maintenance with DBSP' from Glauber Costa
Implement very basic views using DBSP
This is just the bare minimum that I needed to convince myself that this
 approach will work. The only views that we support are slices of the
 main table: no aggregations, no joins, no projections.
 * drop view is implemented.
 * view population is implemented.
 * deletes, inserts and updates are implemented.
 much like indexes before, a flag must be passed to enable views.

Closes #2530
2025-08-11 14:09:35 +03:00
Pekka Enberg
fb023ac62d Merge 'SQLite C API improvements: add bind_text and bind_blob' from Danawan Bimantoro
Add support for more of the SQLite C API.
Bind functions:
- sqlite3_bind_text (with destructor callback)
- sqlite3_bind_blob
Column functions:
- sqlite3_column_text
- sqlite3_column_blob
- sqlite3_column_bytes

Closes #2528
2025-08-11 12:32:46 +03:00
Pekka Enberg
f65a12a699 Merge 'perf/clickbench: enable rest of queries since we support DISTINCT and REGEXP_REPLACE' from Jussi Saurio
Closes #2537
2025-08-11 12:32:02 +03:00
Pekka Enberg
cdaea7f274 core/vdbe: Make apply_view_deltas() return early if views are disabled
Currently, we have a borrow problem because parse_schema_rows() already
borrows `schema`, but then `apply_view_deltas` does the same:

```
thread 'main' panicked at core/vdbe/mod.rs:450:49:
already mutably borrowed: BorrowError
stack backtrace:
   0: __rustc::rust_begin_unwind
             at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/std/src/panicking.rs:697:5
   1: core::panicking::panic_fmt
             at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/core/src/panicking.rs:75:14
   2: core::cell::panic_already_mutably_borrowed
             at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/core/src/cell.rs:799:5
   3: core::cell::RefCell<T>::borrow
             at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/core/src/cell.rs:987:25
   4: turso_core::vdbe::Program::apply_view_deltas
             at ./core/vdbe/mod.rs:450:26
   5: turso_core::vdbe::Program::commit_txn
             at ./core/vdbe/mod.rs:468:9
   6: turso_core::vdbe::execute::op_halt
             at ./core/vdbe/execute.rs:1954:15
   7: turso_core::vdbe::Program::step
             at ./core/vdbe/mod.rs:430:19
   8: turso_core::Statement::step
             at ./core/lib.rs:1914:23
   9: turso_core::util::parse_schema_rows
             at ./core/util.rs:91:15
  10: turso_core::Connection::parse_schema_rows::{{closure}}
             at ./core/lib.rs:1518:17
  11: turso_core::Connection::with_schema_mut
             at ./core/lib.rs:1625:9
  12: turso_core::Connection::parse_schema_rows
             at ./core/lib.rs:1515:9
```

However, this is a read transaction and views are not even enabled,
let's just make `apply_view_deltas()` return early if there's no
processing needed, to skip the schema borrow altogether.
2025-08-11 12:26:11 +03:00
Pekka Enberg
e829201fdd cli: Fix .schema SQL statement some more
We need to fetch name and type too, but also sort in both places
consistently.
2025-08-11 11:52:57 +03:00
Pekka Enberg
4923d95ca3 cli: Fix schema object ordering
SQLite orders schema objects by rowid, not by name.
2025-08-11 11:43:23 +03:00
Jussi Saurio
51f2aad7a4 perf/clickbench: enable rest of queries since we support DISTINCT and REGEXP_REPLACE 2025-08-11 11:32:37 +03:00
Pekka Enberg
3aa885690c core/vdbe: Don't call rowid() unless view processing is enabled
Currently, the simulator complains of the following error:

```
Error: failed with error: 'attempt to multiply with overflow'
```

However, we don't enable views in the simulator so -- despite being an
issue -- we should never see this. Let's fix `op_delete()` some more not
to not even call rowid() unless view processing is enabled.
2025-08-11 10:56:58 +03:00
Pekka Enberg
6f3278f6ed core/vdbe: Perform view processing in op_delete only if views are enabled
Like in op_insert(), let's perform view processing only if views are
actually enabled.
2025-08-11 10:26:16 +03:00
Braden Wong
281eb0d451 docs: improve README initialization section clarity
- Add explicit 'turso' command example in shell block
- Separate shell command from interactive session output
- Add context explaining what the command does
- Improve copy-paste experience for new users
- Follow standard CLI documentation patterns

Fixes unclear initialization flow where users didn't know
what command to run after installation.
2025-08-11 00:25:30 -07:00
Pekka Enberg
8a31fc069d Merge branch 'main' into dbsp-views 2025-08-11 10:08:18 +03:00
Pekka Enberg
a9fdaa8305 Merge 'Add table name to the delete bytecode' from Glauber Costa
When building views (soon), it will be important to know which table is
being deleted. Getting from the cursor id is very cumbersome.
What we are doing here is symmetrical to op_insert, and sqlite also
passes table information in one of the registers (p4)

Closes #2529
2025-08-11 09:50:15 +03:00
Piotr Rzysko
40a8058083 Use mimalloc in benchmark.rs 2025-08-11 08:02:35 +02:00
bit-aloo
4dfa0d77c5 put freelist_count lexicographically in pragma name enum 2025-08-11 11:06:56 +05:30
Pekka Enberg
62f1fd2038 core/incremental: Make clippy happy 2025-08-11 08:36:53 +03:00
Pekka Enberg
87322ad1e4 core/incremental: Evaluate view expressions
...tests were failing because we are testing with expressions, but
didn't support them.
2025-08-11 08:27:10 +03:00