Commit Graph

10673 Commits

Author SHA1 Message Date
Pavan Nambi
826c6c7ee6 Update docs/manual.md
Co-authored-by: Jamie Barton <jamie@notrab.dev>
2025-09-01 16:18:23 +05:30
bit-aloo
f11e90c94d refactor Aegis256Cipher to implement AeadCipher 2025-09-01 16:18:22 +05:30
Pavan Nambi
2fb2366105 Update docs/manual.md
Co-authored-by: Jamie Barton <jamie@notrab.dev>
2025-09-01 16:18:16 +05:30
bit-aloo
c685c4e735 Add AeadCipher trait abstraction
- Define a common trait `AeadCipher` for encryption/decryption.
- Provide methods for both "combined" and "detached" encryption modes:
  - encrypt / decrypt
  - encrypt_detached / decrypt_detached
2025-09-01 16:16:41 +05:30
bit-aloo
3a9b5cc6fa simplify aes-gcm imports and add tag size constants 2025-09-01 16:15:57 +05:30
Pavan Nambi
4538455fe4 Update docs/manual.md
Co-authored-by: Jamie Barton <jamie@notrab.dev>
2025-09-01 16:05:53 +05:30
Pavan Nambi
d969902809 Update docs/manual.md
Co-authored-by: Jamie Barton <jamie@notrab.dev>
2025-09-01 16:05:46 +05:30
Pavan Nambi
98f6ed6b61 Update docs/manual.md
Co-authored-by: Jamie Barton <jamie@notrab.dev>
2025-09-01 16:05:39 +05:30
Pavan Nambi
3aa85a46e0 Update docs/manual.md
Co-authored-by: Jamie Barton <jamie@notrab.dev>
2025-09-01 16:05:32 +05:30
Pavan Nambi
7a26351efc Update docs/manual.md
Co-authored-by: Jamie Barton <jamie@notrab.dev>
2025-09-01 16:05:23 +05:30
Pavan Nambi
635720ed74 Update docs/manual.md
Co-authored-by: Jamie Barton <jamie@notrab.dev>
2025-09-01 16:05:15 +05:30
Pekka Enberg
e209a17780 Merge 'Support encryption for raw WAL frames' from Gaurav Sarma
Fixes https://github.com/tursodatabase/turso/issues/2704
The PR decrypts the page referred to by the WAL frame while reading raw
frames.
<img width="923" height="189" alt="Screenshot 2025-08-31 at 12 42 53 AM"
src="https://github.com/user-
attachments/assets/5e353cf3-aae7-4260-9378-ee2a2cde3f69" />

Reviewed-by: Avinash Sajjanshetty (@avinassh)

Closes #2762
2025-09-01 13:14:08 +03:00
Pavan-Nambi
b122e0cc0e add docs to cdc 2025-09-01 13:31:21 +05:30
TcMits
6e87b08d64 faster type_from_name 2025-09-01 14:38:38 +07:00
Gaurav Sarma
453cbd3201 Decrypt WAL page while reading raw frames 2025-09-01 15:29:01 +08:00
Pekka Enberg
d6543ac25c Merge 'Simulator Profiles' from Pedro Muniz
## Changes
- Refactor sql generation to always accept a `Context` trait object so
we can query the current Generation `Opts`. This change allows us to be
more granular in generating our sql statements. It also opens
opportunities for us to add even more knobs to tweak generation as
needed. I tried to make this as generic as possible as I believe this
library can be useful for fuzz testing outside the simulator.
- Introduce `Profile` struct that aggregates the different
configurations needed to execute the simulator. With this Profile struct
we can bias sql generation towards different statements and create
predefined profiles.
`WriteHeavy` Profile:
```rust
Profile {
            query: QueryProfile {
                gen_opts: Opts {
                    // TODO: in the future tweak blob size for bigger inserts
                    // TODO: increase number of rows as well
                    table: TableOpts {
                        large_table: LargeTableOpts {
                            large_table_prob: 0.4,
                            ..Default::default()
                        },
                        ..Default::default()
                    },
                    query: QueryOpts {
                        insert: InsertOpts {
                            min_rows: NonZeroU32::new(5).unwrap(),
                            max_rows: NonZeroU32::new(11).unwrap(),
                        },
                        ..Default::default()
                    },
                    ..Default::default()
                },
                select_weight: 30,
                insert_weight: 70,
                delete_weight: 0,
                update_weight: 0,
                ..Default::default()
            },
            ..Default::default()
        };
```
As you can see we disable the `delete` and `update` weights, decrease
`select` and increase `insert` weights. This means that we disable
updates and deletes in favor of inserting more data and checking the
validity of the database with fewer select statements.
- `Profile` and `Opts` are validated with `garde` and can generate json
schemas with `schemars` so that we can have editor integration when
creating new profiles to play with.
- Added some docs in the README explaining how you can add LSP
integration for the Json config by generating a `JsonSchema` file

Closes #2852
2025-09-01 10:26:33 +03:00
Pekka Enberg
0a01d4841d Merge 'bindings/java: Implement date, time related methods under JDBC4PreparedStatement' from Kim Seon Woo
- Implement data and time related methods under JDBC4PreparedStatement

Closes #2864
2025-09-01 10:06:16 +03:00
Pekka Enberg
9d06e0bf8e Merge 'Support encryption for non-4k page size' from
Closes #2734.

Reviewed-by: Avinash Sajjanshetty (@avinassh)

Closes #2860
2025-09-01 10:05:52 +03:00
Pekka Enberg
8e5e752722 Merge 'Support cipher and encryption key URI options' from William Souza
Closes #2851

Reviewed-by: Avinash Sajjanshetty (@avinassh)

Closes #2857
2025-09-01 08:25:29 +03:00
TcMits
ed1fb4cabc remove unnecessary check 2025-09-01 11:51:51 +07:00
Piotr Rzysko
6f1cd17fcf Consolidate methods emitting AggStep 2025-08-31 13:29:10 +02:00
Piotr Rzysko
cdba1f1b87 Generalize GroupByAggArgumentSource
This is primarily a mechanical change: the enum was moved between files,
renamed, and its comments updated so it is no longer strictly tied to
GROUP BY aggregations.

This prepares the enum for reuse with ungrouped aggregations.
2025-08-31 13:23:12 +02:00
Piotr Rzysko
0a85883ee2 Support external aggregate functions in GROUP BY 2025-08-31 12:02:11 +02:00
Piotr Rzysko
7d179bd9fe Fix handling of multiple arguments in aggregate functions
This bug occurred when arguments were read for the GROUP BY sorter — all
arguments were incorrectly resolved to the first column. Added tests
confirm that aggregates now work correctly both with and without the
sorter.
2025-08-31 12:02:11 +02:00
Piotr Rzysko
3ad4016080 Fix handling of zero-argument grouped aggregations
This commit consolidates the creation of the Aggregate struct, which was
previously handled differently in `prepare_one_select_plan` and
`resolve_aggregates`. That discrepancy caused inconsistent handling of
zero-argument aggregates.

The queries added in the new tests would previously trigger a panic.
2025-08-31 12:02:09 +02:00
TcMits
37f33dc45f add eq/contains/starts_with/ends_with_ignore_ascii_case 2025-08-31 16:18:42 +07:00
TcMits
73c6070e96 Merge branch 'main' into perf-3 2025-08-31 14:35:58 +07:00
TcMits
190e9bcc95 add match_ignore_ascii_case macro 2025-08-31 14:35:03 +07:00
김선우
424275b60b Apply lint 2025-08-31 16:15:37 +09:00
Piotr Rzysko
978a78b79a Handle COLLATE clause in grouped aggregations
Previously, it was only applied to ungrouped aggregations.
2025-08-31 06:51:26 +02:00
Glauber Costa
8fd6cadaa5 fix column count in ImmutableRow
When we create an ImmutableRow::from_value(), we are always adding a
null padding at the end. We didn't notice this before, because a SQLite
file with an extra column is as valid as any. But that column of course
should not be there.

I traced this to column_count(), which is off by one. My understanding
is that we should be returning based on serial_types, not offset.
2025-08-30 20:08:39 -05:00
luizgfc
528cab55c1 core/printf: %o substitution type implementation 2025-08-30 21:55:22 -03:00
luizgfc
38d528537a core/printf: %x and %X substitution types implementation 2025-08-30 21:53:48 -03:00
luizgfc
3f7a7d0e39 core/printf: %c substitution type implementation 2025-08-30 21:49:59 -03:00
luizgfc
078b0aca79 core/printf: %e and %E substitution types implementation 2025-08-30 21:41:59 -03:00
luizgfc
82a5a16478 core/printf: %u substitution type implementation 2025-08-30 21:41:59 -03:00
rajajisai
975a83c719 Include test 2025-08-30 16:13:44 -04:00
rajajisai
3409de3c47 Include page size when initializing encryption module
Move default page size to test

Store page_size as usize

clippy

fix import and move const inside test module
2025-08-30 16:13:44 -04:00
William Souza
0a6c3872a7 add test for encryption URI options 2025-08-30 15:56:43 -03:00
pedrocarlo
2cc0bb12d7 add Simulator profiles to CI 2025-08-30 13:09:27 -03:00
pedrocarlo
4f2bc96dbe add Faultless profile 2025-08-30 13:07:19 -03:00
Pekka Enberg
3c9dbfb09e Turso 0.1.5-pre.1 2025-08-30 18:28:38 +03:00
pedrocarlo
5881ee71d6 clippy 2025-08-30 12:21:37 -03:00
pedrocarlo
961c0cd282 script to save JsonSchema for editor integration 2025-08-30 12:17:50 -03:00
pedrocarlo
9aac45c3de small docs for profile 2025-08-30 11:31:52 -03:00
pedrocarlo
b9cc556a55 adjust write heavy profile to insert more rows 2025-08-30 11:31:52 -03:00
pedrocarlo
61fa7546c1 fold some SimulatorOpts fields to Profile 2025-08-30 11:31:52 -03:00
pedrocarlo
463eb1fefd simplify profile weights for writes 2025-08-30 11:31:52 -03:00
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