Commit Graph

2769 Commits

Author SHA1 Message Date
Nikita Sivukhin
a61736bec1 adjust evaluation of NULL results in WHEN clauses with SQLite spec 2025-02-09 21:33:54 +04:00
Nikita Sivukhin
6d67016492 fix bug after switch from HashMap to Vec 2025-02-09 21:33:37 +04:00
Nikita Sivukhin
c3b7938266 add case expr in fuzzer and adjust probabilities 2025-02-09 21:33:14 +04:00
Pekka Enberg
e3eb2f1a9a Merge 'bindings/java: Remove AbstractDB ' from Kim Seon Woo
## Purpose of this PR
- Remove `AbstractDB` and put limbo db related methods into `LimboDB`
## Changes
- Remove `AbstractDB`
- Implement `close()`
## Reference
- [Issue](https://github.com/tursodatabase/limbo/issues/615)

Closes #946
2025-02-09 17:36:48 +02:00
Pekka Enberg
2a8687d13f Merge 'bindings/java: Implement some minor TODOs ' from Kim Seon Woo
## Changes
- Implement relatively important (TODO) methods first for
`JDBC4Connection`, `JDBC4Statement`, `JDBC4PreparedStatement`
## Reference
- [Issue](https://github.com/tursodatabase/limbo/issues/615)

Closes #945
2025-02-09 17:36:41 +02:00
Pekka Enberg
728e8ca4f1 Merge 'chore: remove unused dependencies' from meteorgan
remove unused dependencies

Closes #948
2025-02-09 17:36:18 +02:00
Pekka Enberg
9e65d7ddea Merge 'perf/prepare: box even more stuff to shrink the YYMINORTYPE enum further' from Jussi Saurio
the boxings will continue until morale improves
<img width="621" alt="Screenshot 2025-02-09 at 14 16 21"
src="https://github.com/user-
attachments/assets/887d218d-3db7-4a64-ad81-b7431adb23bb" />

Closes #947
2025-02-09 17:36:03 +02:00
김선우
2fa3a1e6ae Apply lint 2025-02-09 22:46:48 +09:00
meteorgan
a99d9a8988 chore: remove unused dependencies 2025-02-09 21:05:06 +08:00
Jussi Saurio
a8685c8086 sqlite3-parser: box the Expr in Vacuum 2025-02-09 14:24:55 +02:00
Jussi Saurio
9b0997a60d sqlite3-parser: separate boxed CreateVirtualTable struct 2025-02-09 14:24:55 +02:00
Jussi Saurio
36a3cb1d5e sqlite3-parser: box AlterTable 2025-02-09 14:11:34 +02:00
Jussi Saurio
72a055e5fe sqlite3-parser: box Pragma 2025-02-09 13:10:52 +02:00
Jussi Saurio
23c4106433 sqlite3-parser: separate boxed Insert struct 2025-02-09 13:10:21 +02:00
Jussi Saurio
f0d7d82e1d sqlite3-parser: Box the Expr in Detach 2025-02-09 13:10:21 +02:00
Jussi Saurio
32887518ce sqlite3-parser: separate boxed Delete struct 2025-02-09 13:10:21 +02:00
Jussi Saurio
40a8dc14cd sqlite3-parser: separate boxed SelectInner struct 2025-02-09 12:54:30 +02:00
Jussi Saurio
f75aca67bb sqlite3-parser: separate boxed TriggerCmd struct variants 2025-02-09 12:53:12 +02:00
Jussi Saurio
af920a317c sqlite3-parser: separate boxed Update struct 2025-02-09 12:53:12 +02:00
Jussi Saurio
575b484740 sqlite3-parser: separate boxed CreateTrigger struct 2025-02-09 12:50:00 +02:00
Jussi Saurio
358fda2ec7 sqlite3-parser: box the create table body 2025-02-09 12:42:53 +02:00
Jussi Saurio
d177f6195b sqlite3-parser: box big members of createindex 2025-02-09 12:34:53 +02:00
김선우
e0b0a667bb Implement close 2025-02-09 18:40:50 +09:00
김선우
d51c1dc5b1 Remove AbstractDB and move those methods into LimboDB 2025-02-09 18:40:42 +09:00
김선우
d1789d1d6e Implement executeUpdate 2025-02-09 17:49:16 +09:00
김선우
ed9cf63c51 Implement abort 2025-02-09 17:37:19 +09:00
김선우
968ae74810 Implement isValid 2025-02-09 17:28:32 +09:00
김선우
4e067b2997 Throw exceptions on unsupported methods 2025-02-09 17:24:52 +09:00
김선우
1f3ddaeec6 Implement prepareStatement 2025-02-09 17:24:35 +09:00
김선우
79e2fba424 Implement minor methods/features in JDBC4Connection.java 2025-02-09 17:17:47 +09:00
Pekka Enberg
e406a030e6 Merge 'Rework io_uring feature' from Jorge López Tello
This makes io_uring the default in CLI, but makes it non-default in
core. Before, if one built CLI without io_uring, core still built with
it as it was a default feature. To accommodate for the change, all
bindings have been updated to select the feature, except for WASM which
has a separate fs implementation.
This also adds some #[cfg] and #[allow] to silence unused-* warnings,
which I discovered when testing with different features disabled.

Closes #942
2025-02-09 08:46:29 +02:00
Pekka Enberg
3178e975b9 Merge 'perf/prepare: box many less frequently used AST nodes' from Jussi Saurio
`sqlite3-parser` spends a lot of time in `yy_reduce` assigning different
`enum YYMINORTYPE` members, and it suffers from bad performance because
the stack size of the enum is very large, and the size of individual
members varies wildly. This PR reduces the `YYMINORTYPE` stack size from
496 to 264 bytes and has the following effect:
Preparing statement:
```sql
Prepare `SELECT 1`/Limbo/SELECT 1
                        time:   [620.37 ns 621.08 ns 621.79 ns]
                        change: [-17.811% -17.582% -17.380%] (p = 0.00 < 0.05)
                        Performance has improved.

Prepare `SELECT * FROM users LIMIT 1`/Limbo/SELECT * FROM users LIMIT 1
                        time:   [1.2215 µs 1.2231 µs 1.2248 µs]
                        change: [-12.926% -12.627% -12.272%] (p = 0.00 < 0.05)
                        Performance has improved.

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.0152 s (
Prepare `SELECT first_name, count(1) FROM users GROUP BY first_name HAVING count(1) > 1 ORDER BY cou...
                        time:   [3.1056 µs 3.1096 µs 3.1138 µs]
                        change: [-13.279% -12.995% -12.712%] (p = 0.00 < 0.05)
                        Performance has improved.

```
Execute (mainly to check for regressions):
```sql
Execute `SELECT * FROM users LIMIT ?`/Limbo/1
                        time:   [402.19 ns 402.75 ns 403.36 ns]
                        change: [-3.4845% -2.4003% -1.6539%] (p = 0.00 < 0.05)
                        Performance has improved.

Execute `SELECT * FROM users LIMIT ?`/Limbo/10
                        time:   [2.7920 µs 2.7977 µs 2.8036 µs]
                        change: [-1.3135% -1.0123% -0.7132%] (p = 0.00 < 0.05)
                        Change within noise threshold.

Execute `SELECT * FROM users LIMIT ?`/Limbo/50
                        time:   [13.577 µs 13.633 µs 13.690 µs]
                        change: [-1.7709% -1.3575% -0.9563%] (p = 0.00 < 0.05)
                        Change within noise threshold.
```

Closes #936
2025-02-09 08:45:42 +02:00
Pekka Enberg
55e873cf49 Merge 'cli: Improve pretty mode table' from wyhaya
This PR replace `cli-table` with [comfy-
table](https://github.com/nukesor/comfy-table), with the following
improvements:
* Limit value to 1 line, regardless of whether they contain line breaks
* Truncate excess content when the complete content cannot be displayed
* Adapt to terminal width
* Fix #928
```sql
limbo> .mode pretty

limbo> CREATE TABLE "test" ("id" text NOT NULL, "age" integer, "height" real, PRIMARY KEY ("id"));
-- No output

limbo> INSERT INTO "test" ("id", "age", "height")
VALUES
('8f67b3fa-ad9a-4b51-947f-778b80a0b350', 477557, 79.34657),
('1ee52440-ccc7-4a88-bb25-46f2da1f9f69', 5963124, 43.86521),
('bb1f6009-dbcb-4e61-b958-b3a7f5153bba', 6822724, 16.318216);
-- No output

limbo> SELECT * FROM test;
┌──────────────────────────────────────┬─────────┬───────────┐
│ id                                   │ age     │ height    │
├──────────────────────────────────────┼─────────┼───────────┤
│ 8f67b3fa-ad9a-4b51-947f-778b80a0b350 │  477557 │  79.34657 │
├──────────────────────────────────────┼─────────┼───────────┤
│ 1ee52440-ccc7-4a88-bb25-46f2da1f9f69 │ 5963124 │  43.86521 │
├──────────────────────────────────────┼─────────┼───────────┤
│ bb1f6009-dbcb-4e61-b958-b3a7f5153bba │ 6822724 │ 16.318216 │
└──────────────────────────────────────┴─────────┴───────────┘
-- Column names are left-aligned and bolded
-- Text is left-aligned
-- Numbers are right-aligned

limbo> CREATE TABLE empty(id text, age integer, data blob);
limbo> SELECT * FROM empty;
┌────┬─────┬──────┐
│ id │ age │ data │
├────┼─────┼──────┤
└────┴─────┴──────┘
-- No rows

limbo> select * from test;
┌───────────────┬─────────┬───────────┐
│ id            │ age     │ height    │
├───────────────┼─────────┼───────────┤
│ 8f67b3fa-ad9… │  477557 │  79.34657 │
├───────────────┼─────────┼───────────┤
│ 1ee52440-ccc… │ 5963124 │  43.86521 │
├───────────────┼─────────┼───────────┤
│ bb1f6009-dbc… │ 6822724 │ 16.318216 │
└───────────────┴─────────┴───────────┘
-- Content will be truncated if the terminal width is insufficient
```
https://github.com/user-
attachments/assets/84dca32d-315f-4991-ad24-b2cdf11bc086

Closes #937
2025-02-09 08:45:26 +02:00
Pekka Enberg
7f9d3f7648 Merge 'simulator: fix shrinking bug' from Alperen Keleş
Fixes https://github.com/tursodatabase/limbo/issues/924

Closes #935
2025-02-09 08:45:11 +02:00
Pekka Enberg
ebbb84bb70 Merge 'github.com/penberg/limbo was moved to github.com/tursodatabase/limbo' from Gustavo Sverzut Barbieri
Adjust all the references since they were broken

Reviewed-by: Preston Thorpe (@PThorpe92)
Reviewed-by: Ricardo Dalarme (@ricardodalarme)

Closes #933
2025-02-09 08:44:39 +02:00
Jorge López
83b158fb3a core: silence some unused warnings when building without default features 2025-02-09 01:13:12 +01:00
Jorge López
c07c08aa98 core: make io_uring feature non-default. All crates that depend on core select it by default. This enables us to build CLI without io_uring, which before this commit would still have used io_uring in core. 2025-02-09 01:12:27 +01:00
Jorge López
62dea0b12b cli: select io_uring feature by default 2025-02-09 01:11:00 +01:00
Jorge López
be5ea350bb bindings: select io_uring feature from limbo_core explicitly as it will be made non-default 2025-02-09 01:10:35 +01:00
alpaylan
7ddbcf07af fix formatting 2025-02-08 15:41:57 -05:00
alpaylan
69d72da837 fix the diff computing algorithm 2025-02-08 12:53:25 -05:00
Jussi Saurio
4faadd86b0 sqlite3-parser: box the InsertBody 2025-02-08 18:10:26 +02:00
Jussi Saurio
781aa3b5d6 sqlite3-parser: box the having clause in GroupBy 2025-02-08 18:10:26 +02:00
Jussi Saurio
2a82091cb3 sqlite3-parser: box the where clause in Update 2025-02-08 18:10:26 +02:00
Jussi Saurio
7426204204 sqlite3-parser: box Following and Preceding in FrameBound 2025-02-08 18:10:26 +02:00
Jussi Saurio
ac7f9d67b7 sqlite3-parser: box large members of Upsert 2025-02-08 18:10:25 +02:00
Jussi Saurio
f341474fee sqlite3-parser: box large members of CreateTrigger 2025-02-08 18:10:25 +02:00
Jussi Saurio
0dba39b025 sqlite3-parser: box everything in Attach 2025-02-08 18:10:25 +02:00
Jussi Saurio
670dac5939 sqlite3-parser: box the where clause in Delete 2025-02-08 18:10:25 +02:00
wyhaya
e9046fef78 cli: Improve pretty mode table 2025-02-09 00:01:07 +08:00