Commit Graph

90 Commits

Author SHA1 Message Date
Pekka Enberg
9973c22137 core: Specify mimalloc version
The "*" version is not allowed on crates.io.
2025-02-18 19:40:00 +02:00
Pekka Enberg
ac54c35f92 Switch to workspace dependencies
...makes it easier to specify a version, which is needed for `cargo publish`.
2025-02-12 17:28:04 +02:00
Doug Anderson444
2566577b70 libc dep only when io_uring feature 2025-02-11 09:06:26 -04:00
Doug Anderson444
39c3b135e3 make all serde optional
to reduce dep size
2025-02-11 09:05:34 -04:00
Doug Anderson444
0aa5de6d9f rm log, switch all to tracing 2025-02-11 09:03:36 -04:00
Doug Anderson444
3734870c6b rm old julian dep 2025-02-10 22:00:18 -04:00
Doug Anderson444
0423945803 restrict chrono to no-dfault-features, update julian_day_converter
chrono has default features that are incompatible with some targets, such as non-js WebAssembly.

Removing the unused defaults allows limbo to compile to these targets
2025-02-10 21:58:34 -04:00
l.gualtieri
3487969c40 fix floating point numbers get truncated in json #877 2025-02-10 12:23:43 +01:00
Pekka Enberg
2eda8a54d9 Merge 'Fix various bugs in B-Tree handling' from Nikita Sivukhin
This PR introduce simple fuzz test for BTree insertion algorithm and
fixes few bugs found by fuzzer
- BTree algorithm returned early although there were overflow pages on
stack and more rebalances were needed
- BTree balancing algorithm worked under assumption that single page
will be enough for rebalance - although this is not always true (if page
were tightly packed with relatively big cells, insertion of new very big
cell can require 3 split pages to distribute the content between them)
- `overflow_cells` wasn't cleared properly during rebalancing
- insertions of dividers to the parent node were implemented incorrectly
- `defragment_page` didn't reset
`PAGE_HEADER_OFFSET_FRAGMENTED_BYTES_COUNT` field which can lead to
suboptimal usage of pages

Closes #951
2025-02-10 07:40:27 +02:00
meteorgan
a99d9a8988 chore: remove unused dependencies 2025-02-09 21:05:06 +08: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
Nikita Sivukhin
75e2f01ec4 print btree for debugging 2025-02-08 13:03:38 +04:00
Nikita Sivukhin
55dd108878 setup simple insertion fuzz test 2025-02-08 12:38:32 +04:00
PThorpe92
661c74e338 Apply new planner structure to virtual table impl 2025-02-06 09:15:28 -05:00
Pekka Enberg
238fb9c977 Merge 'Sqlean Crypto extension' from Diego Reis
Introduces a new `crypto` extension, compatible with the Sqlean [crypto
extension](https://github.com/nalgeon/sqlean/blob/main/docs/crypto.md).

Closes #903
2025-02-06 13:46:01 +02:00
Diego Reis
05057a04ac completes crypto extension
It aims to be compatible with https://github.com/nalgeon/sqlean/blob/main/docs/crypto.md
2025-02-06 01:42:47 -03:00
Diego Reis
dd58be3b60 Add basic structure for crypto extension 2025-02-05 23:09:26 -03:00
krishvishal
a3d0e1e974 Remove vector extension from different Cargo.toml files and add quickcheck, quickcheck_macros
and `rand` crates to core's Cargo.toml file
2025-02-06 06:58:41 +05:30
Pekka Enberg
44ca85e121 core: Enable MVCC benchmark 2025-02-05 13:26:05 +02:00
Pekka Enberg
fad479ac59 core/mvcc: Move source code to module 2025-02-05 13:25:16 +02:00
Pekka Enberg
e4d7474372 core: Switch to parking_lot for RwLock
We really need to make the WAL lock less expensive, but switching to
`parking_lot` is anyway something we should do.

Before:

```
Execute `SELECT 1`/Limbo
                        time:   [56.230 ns 56.463 ns 56.688 ns]
```

After:

```
Execute `SELECT 1`/Limbo
                        time:   [52.003 ns 52.132 ns 52.287 ns]
```
2025-02-04 18:38:33 +02:00
pedrocarlo
309591044b Merge branch 'main' into feature/time-ext 2025-01-31 22:54:14 -03:00
Glauber Costa
a7cc367c1f implement pragma pragma_list
List all available pragmas (Except pragma_list)
2025-01-31 06:44:56 -05:00
pedrocarlo
643ad147c0 checkpoint: implemented time_now, time_fmt_iso, time_date 2025-01-30 01:26:47 -03:00
Pekka Enberg
cfc585813b Merge 'implement sqlite_source_id function' from Glauber Costa
Closes #811
2025-01-29 09:45:00 +02:00
Glauber Costa
8f24d18ad8 implement sqlite_source_id function 2025-01-28 14:55:38 -05:00
Pekka Enberg
ee05ad172b core: Bundle vector extension by default 2025-01-28 14:24:09 +02:00
PThorpe92
c5e60d8e08 Enable only uuid by default, change tests back to account for this 2025-01-21 10:20:01 -05:00
PThorpe92
f13d035965 Enable wasm to static link extensions 2025-01-21 09:36:49 -05:00
PThorpe92
3d188eba0f Enable staticly linking with builtin extensions 2025-01-21 09:32:43 -05:00
Pekka Enberg
93903555aa Rename limbo_extension crate to limbo_ext 2025-01-16 14:40:52 +02:00
Pekka Enberg
f83b34287e Move limbo_extension crate to extensions/core 2025-01-16 14:39:12 +02:00
PThorpe92
3412a3d4c2 Rough design for extension api/draft extension 2025-01-14 07:20:48 -05:00
PThorpe92
0a10d893d9 Sketch out runtime extension loading 2025-01-14 07:18:07 -05:00
Jorge López
a16282ea62 core: remove nix as a dependency 2025-01-14 11:06:13 +01:00
Pekka Enberg
d223c72d03 Revert "core: Previous commits didn't actually remove nix as dependency, so do that here"
This reverts commit cca3846f95, we need to
bring it back unfortunately.
2025-01-14 10:25:11 +02:00
Jorge López
cca3846f95 core: Previous commits didn't actually remove nix as dependency, so do that here 2025-01-13 21:15:36 +01:00
Jorge López
d4de451d45 core: enable rustix/io_uring with io_uring feature 2025-01-13 20:21:15 +01:00
Jorge López
e5bd39a8b2 Tiny formatting change, because RustRover keeps redoing it. Having to revert on every commit is not fun. 2025-01-11 15:03:26 +01:00
Jorge López
737533e35f Prepare Cargo.toml for upcoming rewrite from macos->unix and linux->io_uring. Make io_uring an optional dependency that is only enabled with a new default feature io-uring. 2025-01-07 15:17:24 +01:00
Samyak S Sarnayak
c09a0bcbf3 Nicer parse errors using miette
I noticed that the parse errors were a bit hard to read - only the nearest token and the line/col offsets were printed.

I made a first attempt at improving the errors using [miette](https://github.com/zkat/miette).
- Added derive for `miette::Diagnostic` to both the parser's error type and LimboError.
- Added miette dependency to both sqlite3_parser and core. The `fancy` feature is only enabled for CLI.

Some future improvements that can be made further:
- Add spans to AST nodes so that errors can better point to the correct token. See upstream issue: https://github.com/gwenn/lemon-rs/issues/33
- Construct more errors with offset information. I noticed that most parser errors are constructed with `None` as the offset.

Comparisons.
Before:
```
❯ cargo run --package limbo --bin limbo database.db --output-mode pretty
...
limbo> selet * from a;
[2025-01-05T11:22:55Z ERROR sqlite3Parser] near "Token([115, 101, 108, 101, 116])": syntax error
Parse error: near "selet": syntax error at (1, 6)
```

After:
```
❯ cargo run --package limbo --bin limbo database.db --output-mode pretty
...
limbo> selet * from a;
[2025-01-05T12:25:52Z ERROR sqlite3Parser] near "Token([115, 101, 108, 101, 116])": syntax error

  × near "selet": syntax error at (1, 6)
   ╭────
 1 │ selet * from a
   ·     ▲
   ·     ╰── syntax error
   ╰────

```
2025-01-05 17:56:59 +05:30
psvri
4368e8767b Fix like function giving wrong results 2024-12-26 22:38:54 +05:30
Pekka Enberg
37e1f35df8 Fix Cargo.toml in macros crate 2024-12-25 11:54:16 +02: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
fcab0ae299 Add uuid support for v4 and v7 2024-12-21 09:13:46 -05: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
Pere Diaz Bou
1a663a6ed7 cargo stuff rm 2024-12-13 13:09:13 +01:00
Pekka Enberg
ab07c77036 Upgrade pprof to 0.14
Github's dependabot complains that the current version has an unsoudness
issue so let's bump to a newer version:

https://github.com/tursodatabase/limbo/security/dependabot/10
2024-12-11 11:21:09 +02:00