Commit Graph

10673 Commits

Author SHA1 Message Date
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
김선우
8ec7b0b2be Add TODO in getTables 2025-02-09 14:10:55 +09:00
김선우
91e5ed8bb9 Implement driver name and version related methods 2025-02-09 13:54:34 +09:00
김선우
6011526755 Simply copy function logic from sqlite-jdbc 2025-02-09 11:45:34 +09:00
김선우
ea02664f68 Implement getURL() for JDBC4DatabaseMetaData 2025-02-09 10:49:06 +09:00
김선우
f6bd58e7a4 Add JDBC4DatabaseMetaData 2025-02-09 10:45:31 +09:00
김선우
3920539c7e Merge branch 'main' into java-bindings-statement-refactor 2025-02-09 10:26:29 +09: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
Jorge López
d7a6d48d8c core: make storage::wal::CheckPointMode public, because it is needed to implement trait Wal 2025-02-08 21:21:07 +01:00
Jorge López
9aedbf2d45 core: make storage:📟:PageRef public, because it is needed to implement trait Wal 2025-02-08 21:20:51 +01:00
Jorge López
8582a870fd core: make "result" module public, because it is needed to implement trait Wal, which is public 2025-02-08 21:12:56 +01: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
alpaylan
3ae3e650ae fix watch mode bug deleting the last interaction of a property 2025-02-08 10:59:46 -05:00
alpaylan
4362bc16a3 fix formatting 2025-02-08 09:37:08 -05:00
alpaylan
53ce08aefa Merge branch 'main' of https://github.com/tursodatabase/limbo 2025-02-08 09:35:21 -05:00
alpaylan
6308ce4544 fix the shrinking file and poison errors 2025-02-08 09:34:51 -05:00
Gustavo Sverzut Barbieri
cd2d817c10 github.com/penberg/limbo was moved to github.com/tursodatabase/limbo
Adjust all the references since they were broken
2025-02-08 10:21:49 -03:00
PThorpe92
75898027a0 Remove unnecessary reference counting from completion io callbacks 2025-02-08 08:20:19 -05:00
Jussi Saurio
6a75266f14 Update COMPAT.MD to include basic CTE support 2025-02-08 14:50:15 +02:00
Jussi Saurio
9e70e8fe02 Add basic CTE support 2025-02-08 14:50:05 +02:00
Jussi Saurio
338c27dad6 introduce Scope and Cte structs 2025-02-08 14:49:46 +02:00