Commit Graph

8237 Commits

Author SHA1 Message Date
pedrocarlo
2f237fdcfd adjust remaining calculation to use the profile 2025-08-30 11:31:52 -03:00
pedrocarlo
962666831b read Profile file from path or use predefined profiles 2025-08-30 11:31:52 -03:00
pedrocarlo
a1407869d4 add serde, schemars and garde to profiles and options 2025-08-30 11:31:52 -03:00
pedrocarlo
faa943fc76 reduce cloning for pick_unique 2025-08-30 11:31:52 -03:00
pedrocarlo
bc6976fd33 add Select and Insert generation options 2025-08-30 11:31:52 -03:00
pedrocarlo
06b923d0c1 adjust simulator to use correct trait signature 2025-08-30 11:31:52 -03:00
pedrocarlo
9bc8bdb279 all Arbitrary traits need to pass a GenerationContext 2025-08-30 11:31:52 -03:00
pedrocarlo
1a8b78afd8 create ArbitraryContext and ArbitraryContextFrom traits to pass generation context + start implementing them in Table + FromClause 2025-08-30 11:31:52 -03:00
pedrocarlo
e0552629e3 create Generation Options structs 2025-08-30 11:31:52 -03:00
pedrocarlo
ef16bc4cfb add profiles together 2025-08-30 11:31:52 -03:00
pedrocarlo
918c2a3f69 extend latency profile + impl Default manually 2025-08-30 11:31:52 -03:00
pedrocarlo
19d9003cd7 create profiles folder 2025-08-30 11:31:52 -03:00
Pekka Enberg
e1b5f2d948 Merge 'Implement UPSERT' from Preston Thorpe
This PR closes #2019
Implements https://sqlite.org/lang_upsert.html

Closes #2853
2025-08-30 08:54:35 +03:00
Pekka Enberg
13057c8013 testing: Improve insert.test for STRICT mode type case insensitivity 2025-08-30 08:52:05 +03:00
Pekka Enberg
b22f184a19 Merge 'Fix column case sensitivity on strict table' from
closes: #2822
```
turso> insert into strict_table values (1);
turso>
```

Closes #2823
2025-08-30 08:45:28 +03:00
Pekka Enberg
ca7f1002b4 Merge 'Change views to use DBSP circuits' from Glauber Costa
Instead of using static elements, use a dynamically generated DBSP-
circuit to keep views.
The DBSP circuit is generated from the logical plan, which only supports
enough for us to generate the DBSP circuit at the moment.
The state of the view is still kept inside the IncrementalView, instead
of materialized at the operator level. As a consequence, this still
depends on us always populating the view at startup. Fixing this is the
next step.

Closes #2815
2025-08-30 08:44:06 +03:00
Pekka Enberg
e684121469 Merge 'CLI: implement Line output .mode' from Andrey Oskin
This is implementation of #2801, basically repeating of `sqlite` output.
1. I do not want any bike-shedding, so I am totally fine with sqlite
version. For me it was mainly fun trying to work with Rust. On the other
hand, if it will be needed to do it somehow differently, than I am
totally fine with that. Even more fun :-)
2. I do not know where tests for this kind of things are, sorry. If
tests are needed and somebody can point to me to the place where they
can be found, I'll be more than happy to add them as well.
Currently, I can only show how it looks like this way:
```bash
> target/debug/tursodb -m records ../db1
Turso v0.1.4
Enter ".help" for usage hints.
This software is ALPHA, only use for development, testing, and experimentation.
turso> CREATE TABLE test(x INT, some_text TEXT, val DOUBLE);
turso> INSERT INTO test VALUES (100, "very important info", 23.12), (2, NULL, 3.14159265), (98, "yet another very important and long text record", NULL);
turso> SELECT * FROM test;
        x = 100
some_text = very important info
      val = 23.12

        x = 2
some_text = 
      val = 3.14159265

        x = 98
some_text = yet another very important and long text record
      val = 
```

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

Closes #2835
2025-08-30 08:43:31 +03:00
Pekka Enberg
0c16ca9ce9 Merge 'core/wal: cache file size' from Pere Diaz Bou
Closes #2829
2025-08-30 08:41:58 +03:00
Pekka Enberg
e357909cda Merge 'Propagate decryption error from the callback' from Avinash Sajjanshetty
Reviewed-by: Pedro Muniz (@pedrocarlo)

Closes #2843
2025-08-30 08:40:47 +03:00
Pekka Enberg
352099e8ae Merge 'add sqlite integrity check back' from Pedro Muniz
Closes #2719

Reviewed-by: Avinash Sajjanshetty (@avinassh)

Closes #2849
2025-08-30 08:40:21 +03:00
Arkoniak
2c0e3cf593 feat: consistent interrupt event processing (#2801) 2025-08-30 06:57:14 +03:00
Arkoniak
cb602d960d feat: records output (#2801) 2025-08-30 06:57:14 +03:00
PThorpe92
8531560899 Combine rewriting expressions in UPSERT into a single walk of the ast 2025-08-29 22:12:46 -04:00
Preston Thorpe
c844d91866 Merge 'Remove some code duplication in the CLI' from Preston Thorpe
Just some minor refactoring

Closes #2845
2025-08-29 21:48:53 -04:00
Preston Thorpe
18a9a38c8e Merge ' core/translate: parse_table remove unnecessary clone of table name ' from Pere Diaz Bou
```

Benchmarking Prepare `SELECT first_name, count(1) FROM users GROUP BY first_name HAVING count(1) > 1 ORDER BY cou...: Collecting 100 samples in estimated 5.008
Prepare `SELECT first_name, count(1) FROM users GROUP BY first_name HAVING count(1) > 1 ORDER BY cou...
                        time:   [4.0081 µs 4.0223 µs 4.0364 µs]
                        change: [-2.9298% -2.2538% -1.6786%] (p = 0.00 < 0.05)
                        Performance has improved.
                        ```

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

Closes #2847
2025-08-29 21:45:58 -04:00
themixednuts
eb93e4edc9 remove to_upper_case in favor of eq_ignore_ascii_case 2025-08-29 20:24:43 -05:00
themixednuts
f9b0c0aa27 chore: add update test to lowercase
Instead of making a new test that would be the same, just updated this one to show that sqlite and turso (with this pr) match and isnt case sensitive in strict tables.
2025-08-29 20:24:43 -05:00
themixednuts
6ffbdb4908 fix: column case sensitivity on strict table 2025-08-29 20:24:43 -05:00
PThorpe92
0fc603830b Use consistent imports of ast::Expr in upsert 2025-08-29 21:13:03 -04:00
PThorpe92
e175516319 Add more doc comments to upsert.rs 2025-08-29 20:59:02 -04:00
PThorpe92
761da801e8 Add ON CONFLICT DO to COMPAT.md 2025-08-29 20:58:44 -04:00
PThorpe92
3ab2126c89 Comment out tests that require COLLLATE in unique index creation 2025-08-29 20:58:44 -04:00
PThorpe92
e4a0a57227 Change get_column_mapping to return an Option now that we support excluded.col in upsert 2025-08-29 20:58:44 -04:00
PThorpe92
c659a0e4d4 Update upsert test to be more relevant to the exact behavior 2025-08-29 20:58:44 -04:00
PThorpe92
007675a081 Add some more tests for upsert 2025-08-29 20:58:44 -04:00
PThorpe92
2beb8e4725 Add documentation and comments to translate.rs for upsert 2025-08-29 20:58:44 -04:00
PThorpe92
30137145a9 Add documentation and comments to upsert.rs 2025-08-29 20:58:44 -04:00
PThorpe92
1120d73931 Add a bunch of UPSERT tests 2025-08-29 20:58:43 -04:00
PThorpe92
6619b6e5a0 Add upsert test module to tcl tests 2025-08-29 20:58:43 -04:00
PThorpe92
ae6f60b603 initial pass at upsert, integrate upsert into insert translation 2025-08-29 20:58:43 -04:00
PThorpe92
efd15721b1 initial pass at upsert, add upsert.rs 2025-08-29 20:58:43 -04:00
PThorpe92
1c4d1a2f28 Add upsert module to core/translate 2025-08-29 20:58:43 -04:00
Preston Thorpe
4a0655f2b8 Merge 'Update COMPAT.md to remove CREATE INDEX default disabled' from Preston Thorpe
Closes #2854
2025-08-29 20:58:30 -04:00
PThorpe92
8257496411 Update COMPAT.md to remove CREATE INDEX default disabled 2025-08-29 20:44:09 -04:00
Preston Thorpe
0899711439 Merge 'core/translate: remove unneessary agg clones' from Pere Diaz Bou
```
Prepare `SELECT first_name, count(1) FROM users GROUP BY first_name HAVING count(1) > 1 ORDER BY cou...
                        time:   [3.9978 µs 4.0085 µs 4.0193 µs]
                        change: [-5.0734% -4.6271% -4.1644%] (p = 0.00 < 0.05)
```

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

Closes #2846
2025-08-29 11:40:53 -04:00
pedrocarlo
bcd70488ae add sqlite integrity check back 2025-08-29 12:25:27 -03:00
Pere Diaz Bou
d72be206f2 core/translate: parse_table remove unnecessary clone of table name 2025-08-29 16:42:46 +02:00
Pere Diaz Bou
167459389b core/translate: remove unneessary agg clones 2025-08-29 16:23:44 +02:00
Preston Thorpe
dc34097581 Merge 'core/vdbe: Micro-optimize "zero_or_null" opcode' from Pekka Enberg
It's a hot instruction for TPC-H, for example, so worth optimizing.
Reduces op_zero_or_null() from 5.6% to 2.4% in CPU flamegraph for TCP-H
Q1.

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

Closes #2842
2025-08-29 10:23:31 -04:00
Preston Thorpe
eb0f2b7029 Merge 'translate: with_capacity insns' from Pere Diaz Bou
Reviewed-by: Preston Thorpe <preston@turso.tech>

Closes #2831
2025-08-29 10:23:09 -04:00