Commit Graph

1466 Commits

Author SHA1 Message Date
김선우
56165fb0d6 Merge branch 'main' into feature/delete-planning 2024-12-24 12:29:19 +09:00
김선우
906975e1ca Add limit support 2024-12-24 12:25:04 +09:00
jussisaurio
3ab7f7a0b8 Merge 'Use custom expr equality check in translation and planning' from Preston Thorpe
Idk how I missed these during the initial PR 👍

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

Closes #541
2024-12-23 22:58:03 +02:00
Pekka Enberg
0a479a9a4e Merge 'Fix file creation in GenericIO open_file function' from Dezhi Wu
`cargo test` is always failing on FreeBSD, the following is one of the
errors:
```
---- tests::test_simple_overflow_page stdout ----
thread 'tests::test_simple_overflow_page' panicked at test/src/lib.rs:32:84:
called `Result::unwrap()` on an `Err` value: IOError(Os { code: 2, kind: NotFound, message: "No such file or directory" })
```
After some digging, I found that the `open_file` function in
`core/io/generic.rs` does not respect the `OpenFlags::Create` flag. This
commit adds support for file creation in the `open_file` function.
`cargo test` now passes on FreeBSD.

Closes #537
2024-12-23 16:15:11 +02:00
Pekka Enberg
58292c1a42 Merge 'UUID support' from Preston Thorpe
#509
Started the discussion on discord about possibly supporting UUID types
natively. This PR only implements the `sqlean` extension's functions and
behavior, with the only changes being:
1. uuid's are returned as `blob`s by default. (that was an assumption I
made considering perf, thinking this would be preferred if UUID ended up
being a supported native type.  if `text` is preferred I can change it)
2.  `uuidv7` types here can accept an argument of seconds since epoch to
customize the embedded timestamp. The func
`uuidv7_timestamp_ms(string_or_blob_v7)` allows the user to convert
their uuid7 back into the timestamp.
![image](https://github.com/user-
attachments/assets/ca53ee9b-f1f1-410b-955f-acd140bd4989)

Closes #518
2024-12-23 13:21:13 +02:00
PThorpe92
fbf42458b8 Use custom expr equality check in translation and planner 2024-12-22 21:46:31 -05:00
김선우
357ab551a5 nit 2024-12-23 07:42:12 +09:00
김선우
5cdcb8d78c Split Plan into Select and Delete 2024-12-23 05:45:23 +09:00
김선우
f8d4edc8d7 Use schema.get_table(...) instead of referencing directly 2024-12-23 04:54:40 +09:00
김선우
82c127b7a3 Remove bool args in optimize_plan 2024-12-23 04:47:05 +09:00
김선우
6f235e6f6c Fix comment 2024-12-22 21:06:54 +09:00
김선우
e83819ef30 Extract the appending delete related opcodes to emit_delete_opcodes 2024-12-22 16:00:35 +09:00
김선우
1d3ce52812 Refactor planner and optimizer to be DRY 2024-12-22 15:11:26 +09:00
김선우
9bacf80f2e Change to println! 2024-12-22 14:41:12 +09:00
김선우
57c7a56e35 Apply fmt, clippy 2024-12-22 14:27:21 +09:00
김선우
a42b185ece Nit 2024-12-22 14:22:10 +09:00
김선우
9a8b94ef93 First successful implementation of delete planning 2024-12-22 13:16:16 +09:00
Dezhi Wu
bea49549ed feat(core/io): Add support for file creation in open_file function
`cargo test` is always failing on FreeBSD, the following is one of the
errors:

```
---- tests::test_simple_overflow_page stdout ----
thread 'tests::test_simple_overflow_page' panicked at test/src/lib.rs:32:84:
called `Result::unwrap()` on an `Err` value: IOError(Os { code: 2, kind: NotFound, message: "No such file or directory" })
```

After some digging, I found that the `open_file` function in
`core/io/generic.rs` does not respect the `OpenFlags::Create` flag. This
commit adds support for file creation in the `open_file` function.

`cargo test` now passes on FreeBSD.
2024-12-22 11:04:15 +08:00
PThorpe92
c06c4115f1 Adapt OwnedValues in uuid ext to new LimboText 2024-12-21 09:17:53 -05:00
PThorpe92
2fcae80902 Create ext directory for outside funcs, add uuid to ext dir 2024-12-21 09:16:04 -05:00
PThorpe92
f96f289609 Remove unnecessary nanos arg from uuid7, add insn const 2024-12-21 09:13:48 -05:00
PThorpe92
c1561ecbb0 Tests for uuid funcitons, add compat docs 2024-12-21 09:13:48 -05:00
PThorpe92
b207f7ded5 Give uuidv7 optional unix time arg 2024-12-21 09:13:48 -05:00
PThorpe92
fcab0ae299 Add uuid support for v4 and v7 2024-12-21 09:13:46 -05:00
Pekka Enberg
264b901191 Merge 'Macro for generating opcode description from Rustdoc' from Vignesh
Reference Issue: #393
This PR implements a procedural macro derive_description that automates
the generation of a get_description method for enums. The macro extracts
documentation comments (specified with `/// Description...`) associated
with enum variants and generates an implementation that provides
optional descriptions for each variant.

Closes #528
2024-12-21 10:37:01 +02:00
Pekka Enberg
bff2b6016e Merge 'simulator: Use "mod.rs" for module top-level files' from Pekka Enberg
Let's use "mod.rs" for the module top-level file as we do in the rest of
the Limbo codebase for consistency.

Closes #529
2024-12-21 10:29:12 +02:00
Pekka Enberg
13f229020e simulator: Use "mod.rs" for module top-level files
Let's use "mod.rs" for the module top-level file as we do in the rest of
the Limbo codebase for consistency.
2024-12-21 09:50:23 +02:00
vignesh-j-shetty
a43a1d204c renamed macro crate 2024-12-21 13:19:04 +05:30
vignesh-j-shetty
1e72fee343 Implemented proc_macro_derive extract description from rust docs and generate get_description function 2024-12-21 12:23:04 +05:30
Pekka Enberg
64c26e486f Merge 'Structured Generation for the Simulator' from Alperen Keleş
- added Arbitrary and ArbitraryOf<T> traits for mroe centralized
generation
- implemented random generation for tables and structured queries

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

Closes #464
2024-12-21 08:44:05 +02:00
Pekka Enberg
307a7cb5d1 Merge 'Improve error reporting in Python bindings' from amuldotexe
Solving issue #494   , changes made at 5 places where todo macros were
replaced with relevant errors to avoid the crashes _for now_

Reviewed-by: Avinash Sajjanshetty <opensource@avi.im>

Closes #526
2024-12-21 08:34:46 +02:00
alpaylan
8f8b97d54b add the missing rowresult variant 2024-12-20 12:27:54 -05:00
alpaylan
d2723b777b update table create probability, print interactions as info logs 2024-12-20 12:18:03 -05:00
Alperen Keleş
54c3423fec Merge branch 'tursodatabase:main' into main 2024-12-20 12:17:10 -05:00
jussisaurio
82bc9501fd Merge 'feat(optimizer): eliminate between statement' from KaguraMilet
Rewrite `Y BETWEEN X AND Z` as `X <= Y AND Y <= Z`. And due to the
support of this optimization rule, limbo should now be able to execute
the `BETWEEN AND` statement.

Closes #490
2024-12-20 17:23:42 +02:00
KaguraMilet
ef39f11a9f fix(optimizer): process Parenthesized expression 2024-12-20 23:11:17 +08:00
amuldotexe
b7b22f303f ran cargofmt 2024-12-20 20:36:35 +05:30
amuldotexe
f912771ae6 gracefully handling errors for issue https://github.com/tursodatabase/limbo/issues/494 , changes made 5 places where todo macros were replaced with relevant errors 2024-12-20 20:32:03 +05:30
KaguraMilet
d5d7185995 add between expr tests 2024-12-20 22:49:44 +08:00
jussisaurio
5b4ef4412b Merge 'Implement json_array' from Kacper Madej
Implements [json_array](https://sqlite.org/json1.html#jarray).
As a side quest, this PR also fixes an issue with the `CHAR` function
which didn't work properly if the parameters were  non-leaf AST nodes.
The PR is quite big, because as I mentioned in https://github.com/tursod
atabase/limbo/issues/127#issuecomment-2541307979 we had to modify
`OwnedValue::Text` to support a `subtype` parameter, which is what
SQLite does.

Closes #504
2024-12-20 16:35:40 +02:00
Kacper Madej
e2fc03e822 Update COMPAT.md 2024-12-20 11:32:57 +01:00
Kacper Madej
cdb24d3de1 Handle issues with nested arguments 2024-12-20 11:32:57 +01:00
Kacper Madej
19ae42dfa3 Implement json_array 2024-12-20 11:15:48 +01:00
Pekka Enberg
8387e7903c sqlite: Fix source formatting 2024-12-20 09:30:03 +02:00
Pekka Enberg
07ae003db7 Update PERF.md 2024-12-20 09:22:44 +02:00
Pekka Enberg
56710b0187 sqlite3: Implement sqlite3_free_table() 2024-12-20 09:18:31 +02:00
Pekka Enberg
03ae123060 Add PERF.md with Mobibench instructions 2024-12-20 09:15:21 +02:00
Pekka Enberg
d0fa9e07f7 Merge 'sqlite3: Add sqlite3_wal_checkpoint_*() API' from Pekka Enberg
This wires up checkpointing to the SQLite C API. We don't respect the
checkpointing mode because core does not have that nor do we report back
some stats.

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

Closes #480
2024-12-20 09:06:04 +02:00
Pekka Enberg
875619791b Merge 'Implement basic sqlite3_get_table() API' from Diego Reis
#479
This is my first draft for implementing `sqlite3_get_table()`, it is
highly inspired on the actual implementation found [here](https://raw.gi
thubusercontent.com/rusqlite/rusqlite/92fdc11fea0ecea6400dfcb74c1c3ca362
14a7d4/libsqlite3-sys/sqlite3/sqlite3.c), I made some basic manual
testing in `example.c` and it works fine but an extensive test suite is
recommended.

Closes #519
2024-12-20 09:05:50 +02:00
alpaylan
b355568023 use ticks as the main simulator driver, handle disconnects correctly, add multi-connection setup 2024-12-19 23:40:04 -05:00