Commit Graph

1181 Commits

Author SHA1 Message Date
jussisaurio
cc902ed25d GROUP BY and ORDER BY mostly work 2024-11-26 17:31:51 +02:00
jussisaurio
3f9e60633f select refactor: order by and basic agg kinda work 2024-11-26 17:31:51 +02:00
jussisaurio
d0466e1cae introduce Column member of ast::Expr and bind idents to columns 2024-11-26 17:31:51 +02:00
Pekka Enberg
4c5f9eb73b Merge 'contributing: Add note about testing against TPC-H databases' from Jussi Saurio
Reviewed-by: Pere Diaz Bou <pere-altea@homail.com>

Closes #419
2024-11-26 15:56:43 +02:00
jussisaurio
574f52ddbb Add note about testing against TPC-H databases 2024-11-25 21:57:34 +02:00
jussisaurio
418ad40401 Merge 'Fix some Clippy warnings' from Lauri Virtanen
Reviewed-by: Pere Diaz Bou <limeng.1@bytedance.com>

Closes #417
2024-11-25 16:43:06 +02:00
jussisaurio
1651779e4c Merge 'Improve maths support' from Lauri Virtanen
- Add support for division in SQL expressions
- Fix issues with subtraction
- Support multiplication of integers and floats
- Support aggregate functions in mathematical expressions
- Add compatibility tests for mathematical operations, also with
aggregate functions

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

Closes #418
2024-11-25 16:36:45 +02:00
Lauri Virtanen
1b2835b316 Add math operator compatibility tests 2024-11-24 22:12:23 +02:00
Lauri Virtanen
70c4d6b360 Support multiplying combinations of different types 2024-11-24 22:11:37 +02:00
Lauri Virtanen
af9d407dee Fix issues with subtraction of different type combinations 2024-11-24 22:10:23 +02:00
Lauri Virtanen
cafbf5499f Support divide operator in expressions 2024-11-24 22:10:07 +02:00
Lauri Virtanen
afeb1cbe74 Clippy warning fixes 2024-11-24 20:24:47 +02:00
Lauri Virtanen
a7100d8e9b Autofix clippy issues with cargo fix --clippy 2024-11-24 20:24:47 +02:00
Pekka Enberg
aa4dd5c8e7 Merge 'wal: checksums' from Pere Diaz Bou
Implemeted checksums so that sqlite3 is able to read our WAL. This also
helps with future work on proper recovery of WAL.
Create some frames with CREATE TABLE and kill the process so that there
is no checkpoint.
```
Limbo v0.0.6
Enter ".help" for usage hints.
limbo> create table x(x);
limbo> [1]    15910 killed     cargo run xlimbo.db
```
Now sqlite3 is able to recover from this WAL created in limbo:
```
sqlite3 xlimbo.db
SQLite version 3.43.2 2023-10-10 13:08:14
Enter ".help" for usage hints.
sqlite> .schema
CREATE TABLE x (x);
```

Closes #413
2024-11-22 13:21:01 +02:00
jussisaurio
046c4933a5 Merge 'io macro' from Jussi Saurio
just having some dang fun

Reviewed-by: Pere Diaz Bou <pere-altea@hotmail.com>
Reviewed-by: Pere Diaz Bou <pere-altea@hotmail.com>

Closes #385
2024-11-21 20:36:07 +02:00
jussisaurio
c722074016 missing cursorresult handling 2024-11-21 20:29:46 +02:00
jussisaurio
f945795ae6 consistent naming 2024-11-21 20:25:51 +02:00
jussisaurio
d8eb4be424 better, less cool names 2024-11-21 20:23:53 +02:00
jussisaurio
3002f2a552 io macro 2024-11-21 20:23:23 +02:00
jussisaurio
6dc427fc9b Merge 'impl order by desc' from lemonwx
Hi all,
I attempted to implement the `order by desc`, which mainly consists of
the following two parts:
1. for cases where the primary key can be utilized, I implemented
`push_scan_direction` to push the scan direction down to the `Scan`.
2. for cases where the primary key cannot be utilized, I re-implemented
the sorting in `Sorter::rewind` based on whether it's desc or asc.
there is also some related work to be done, such as sort using secondary
index, I will attempt to do next.
Please help review this and let me know how I can improve it, thanks in
advance

Reviewed-by: Pere Diaz Bou <pere-altea@hotmail.com>

Closes #376
2024-11-21 16:37:38 +02:00
Pere Diaz Bou
05a05cfc63 endian naming changes 2024-11-21 11:55:36 +01:00
Pere Diaz Bou
6c14c50d41 wal: checksums
Implemeted checksums so that sqlite3 is able to read our WAL. This also
helps with future work on proper recovery of WAL.

Create some frames with CREATE TABLE and kill the process so that there
is no checkpoint.
```
Limbo v0.0.6
Enter ".help" for usage hints.
limbo> create table x(x);
limbo> [1]    15910 killed     cargo run xlimbo.db
```

Now sqlite3 is able to recover from this WAL created in limbo:

```
sqlite3 xlimbo.db
SQLite version 3.43.2 2023-10-10 13:08:14
Enter ".help" for usage hints.
sqlite> .schema
CREATE TABLE x (x);
```
2024-11-20 20:12:32 +01:00
Pekka Enberg
2d47bc5a38 Fix Python example in README 2024-11-20 20:00:16 +02:00
Pekka Enberg
d73a24ccf4 github: Fix Python release workflow 2024-11-20 19:50:43 +02:00
Pekka Enberg
d940bb1342 github: Try a different path... 2024-11-20 19:41:55 +02:00
Pekka Enberg
9196894d44 github: Use relative path for "dist"
...this should make "upload-artifact" root for current working directory.
2024-11-20 19:36:31 +02:00
Pekka Enberg
866cbd6705 github: Run Python worfklow on tags
We need this to release the packages.
2024-11-20 19:23:11 +02:00
Pekka Enberg
d433bc5d6b Fix typo in README 2024-11-20 19:16:49 +02:00
Pekka Enberg
e1b2d043be Limbo 0.0.8 2024-11-20 19:16:11 +02:00
Pekka Enberg
229e62704b bindings/python: Add Python example 2024-11-20 19:10:02 +02:00
Pekka Enberg
102b0e964a Merge 'github: Add Python package publish workflow' from Pekka Enberg
Fixes #248
Fixes #313

Closes #412
2024-11-20 19:06:18 +02:00
Pekka Enberg
8463443648 github: Add Python package publish workflow
This adds Github actions workflow to publish the Python bindings.

Fixes #248
Fixes #313
2024-11-20 18:57:30 +02:00
Pekka Enberg
41d829275c Update COMPAT 2024-11-20 18:31:40 +02:00
Pekka Enberg
a18f33f93b bindings/wasm: Add example using Drizzle ORM 2024-11-20 18:20:39 +02:00
Pekka Enberg
81b68b7047 Limbo 0.0.7 2024-11-20 18:15:36 +02:00
Pekka Enberg
821b569622 Merge 'Wasm improvements' from Pekka Enberg
Closes #411
2024-11-20 18:13:31 +02:00
Pekka Enberg
a23aa1605a Merge 'Simulator cleanups' from Pekka Enberg
Reviewed-by: Pere Diaz Bou <pere-altea@homail.com>

Closes #410
2024-11-20 18:13:15 +02:00
Pekka Enberg
c4d4136878 Update README 2024-11-20 12:19:00 +02:00
Pekka Enberg
f8667bb160 simulator: Remove seed from SimulatorOpts
It's not used anywhere and technically it's not even part of simulation
options, but the seed that generates them.
2024-11-20 11:55:49 +02:00
Pekka Enberg
39ca03a7ce simulator: Remove unused imports from main.rs 2024-11-20 11:55:49 +02:00
Pekka Enberg
a3078079b4 simulator: Fix clone() on double reference
Switch to to_string() and to_vec() instead of clone() + to_owned() to
fix the following warnings:

warning: using `.clone()` on a double reference, which returns `&String` instead of cloning the inner type
   --> simulator/main.rs:348:68
    |
348 |                         limbo_core::Value::Text(t) => Value::Text(t.clone().to_owned()),
    |                                                                    ^^^^^^^^
    |
    = note: `#[warn(suspicious_double_ref_op)]` on by default

warning: using `.clone()` on a double reference, which returns `&Vec<u8>` instead of cloning the inner type
   --> simulator/main.rs:349:68
    |
349 |                         limbo_core::Value::Blob(b) => Value::Blob(b.clone().to_owned()),
2024-11-20 11:55:49 +02:00
Pekka Enberg
de40442677 core: Remove unused import from btree.rs 2024-11-20 11:55:49 +02:00
Pekka Enberg
20340038a5 bindings/wasm: Add integration tests 2024-11-20 11:54:34 +02:00
Pekka Enberg
bfce49c7eb bindings/wasm: Fix conversion to JsValue 2024-11-20 11:54:34 +02:00
Pekka Enberg
b65d0a72ba bindings/wasm: Implement Statement.raw() 2024-11-20 11:47:28 +02:00
Pekka Enberg
fc07445e0a Merge 'sim: improve simulator' from Pere Diaz Bou
Newly improved simulator with CREATE TABLE, INSERT, SELECT, connection
management, etc...
This new simulator is finding a bunch of bugs with write path so after
this PR I will start fixing those.

Closes #405
2024-11-20 08:59:13 +02:00
Pere Diaz Bou
51ad827f1f fmt 2024-11-19 17:56:24 +01:00
Pere Diaz Bou
e0e2ae9078 print stats 2024-11-19 17:54:32 +01:00
Pere Diaz Bou
269207d5db add rows to env and blob fix 2024-11-19 17:40:42 +01:00
Pere Diaz Bou
f5a1f7c800 various fixes in btree
* read_u8 now takes self.offset into account
* shift cell pointers left on balance_root with offset > 0
* fix wrong writes to page in degragment_page
2024-11-19 17:15:19 +01:00