Commit Graph

1821 Commits

Author SHA1 Message Date
김선우
e687ae3bdf Update README.md 2025-01-14 19:51:50 +09:00
김선우
8e4f6e7d30 Split serde-license.md to serde-apache-license.md and serde-mit-license.md 2025-01-14 19:44:13 +09:00
김선우
8ed2d14ca4 Reposition licenses in core package 2025-01-14 19:42:09 +09:00
김선우
66c9832bec Create top level licenses directory 2025-01-14 19:33:29 +09:00
Pekka Enberg
b6ae8990e3 Limbo 0.0.12 2025-01-14 11:39:17 +02:00
Pekka Enberg
0461fd4c41 Update CHANGELOG 2025-01-14 11:38:26 +02:00
Pekka Enberg
a2506528d8 Merge '[bindings/java] Add support for Java nullability checks ' from Kim Seon Woo
## Purpose of this PR
- Add Nullability checks during compile time
## Changes
- Add `com.user.nullaway:nullaway` dependency for checking null issues
during compile time
  - Related dependencie(`com.google.errorprone`) and plugin
`net.ltgt.errorprone` is added
- Because added dependencies has Apache 2.0 License, added NOTICE.md
under the root directory.
  - Individual license for each dependency is placed under `licenses`
directory
## Note
- This PR has to be merged after
https://github.com/tursodatabase/limbo/pull/646
## Reference
- [Issue](https://github.com/tursodatabase/limbo/issues/615)

Closes #648
2025-01-14 11:25:48 +02:00
김선우
a48cb8bbfc Merge branch 'main' into java-nullability 2025-01-14 17:49:36 +09:00
Pekka Enberg
d4f55d4a1b Merge 'Change VALID_URL_PREFIX to use sqlite instead' from Kim Seon Woo
To maximize compatibility between limbo and sqlite, update
`VALID_URL_PREFIX`
## Reference
- [Issue](https://github.com/tursodatabase/limbo/issues/615)

Closes #674
2025-01-14 10:48:53 +02:00
Pekka Enberg
cd04bf796a Update README.md 2025-01-14 10:34:00 +02:00
Jussi Saurio
d3c2868fcb Merge 'refactor: json functions vdbe code should be consistent with scalar functions' from Jorge Hermo
While working to include new json functions (related to #127) I noticed
that the program step code for json functions https://github.com/tursoda
tabase/limbo/blob/0dceb02ec04241b3772332853bcbfb9eb559adb9/core/vdbe/mod
.rs#L1346 was a bit different from scalar functions's code, where the
match to the inner function is nested https://github.com/tursodatabase/l
imbo/blob/0dceb02ec04241b3772332853bcbfb9eb559adb9/core/vdbe/mod.rs#L142
4
I added the same nesting to the json functions so it is more consistent

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

Closes #663
2025-01-14 10:30:33 +02:00
Pekka Enberg
5c9505e8f7 Revert "core/io/io_uring: replace nix and libc calls with their rustix counterparts."
This reverts commit b146f5d4cb because it
causes tests to hang.
2025-01-14 10:25:23 +02: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
김선우
04cd655574 Change VALID_URL_PREFIX to use sqlite instead 2025-01-14 17:19:33 +09:00
김선우
f604e227b1 Update java.yaml workflow to use java 17 2025-01-14 17:12:50 +09:00
김선우
f03b6bffde Update license path 2025-01-14 17:12:03 +09:00
김선우
5c9990f41a Merge branch 'main' into java-nullability 2025-01-14 17:09:45 +09:00
Pekka Enberg
945a91dee5 Merge 'core: Consolidate libc implementations' from Jorge López Tello
This shaves off `nix` as a dependency in core, which was only being used
in the io_uring backend for the `fcntl` advisory record locking. Since a
previous PR made `rustix` a dep not only for Mac but for any Unix, and
`rustix` also has `fcntl`, `nix` becomes redundant.
Furthermore, it reduces `libc` usage across core. The only remaining
uses are:
```rust
io_uring::opcode::Readv::new(fd, iovec as *const iovec as *const libc::iovec, 1)
io_uring::opcode::Writev::new(fd, iovec as *const iovec as *const libc::iovec, 1)
```
These two are a little ugly, but sadly the `io_uring` crate requires
both opcodes to take a `libc::iovec` while it doesn't export the type.
See tokio-rs/io-uring#259 for a request to use `std::io::IoSlice` or to
export the type directly.
Apart from those two, there are no other usages of libc, so if those are
resolved, we could also drop the dependency on libc.

Closes #668
2025-01-14 10:07:20 +02:00
Pekka Enberg
2186af6c89 Bump "build-native" timeout to 10 minutes 2025-01-14 10:07:00 +02:00
Pekka Enberg
a3b9cf823a Merge 'Initial pass on Rust bindings' from Pekka Enberg
This implements libSQL compatible Rust API on top of Limbo's core. The
purpose of this is to allow libraries and apps that build on libSQL to
use Limbo.

Closes #597
2025-01-14 09:19:50 +02:00
Pekka Enberg
f1b6003d2a Merge 'Fix the rest of the flaky datetime tests' from Preston Thorpe
seeing #660 made me realize I shouldn't have used `now` in any
circumstances in these tests, tolerance or not ;)
they should all be deterministic now

Closes #671
2025-01-14 09:18:17 +02:00
Pekka Enberg
af020c27d6 Initial take on Rust bindings
This implements libSQL compatible Rust API on top of Limbo's core. The
purpose of this is to allow libraries and apps that build on libSQL to
use Limbo.
2025-01-14 09:16:46 +02:00
Pekka Enberg
c66783603f Merge '[bindings/java] Add support for limbo connection using DriverManager' from Kim Seon Woo
## Purpose
- Make DriverManager aware of limbo connection
For example, we can now do as follows:
```java
try (Connection connection = DriverManager.getConnection("jdbc:limbo:sample.db")) {
    assertThat(connection).isNotNull();
}
```
## Changes
- Add following .java files in order for the DriverManager to detect
Limbo
  - JDBC.java
  - JDBC4Connection.java
  - LimboConfig.java
  - LimboConnection.java
  - LimboDataSource.java
## Reference
- This PR has to be merged after following
[PR](https://github.com/tursodatabase/limbo/pull/645)
- [Related issue](https://github.com/tursodatabase/limbo/issues/615)

Closes #646
2025-01-14 09:15:47 +02:00
Jussi Saurio
9178c4943c Merge 'Make translate_* functions accept ProgramBuilder' from Levy A.
Simplifies function signatures and allows attaching more context to
ProgramStatus on `translate::translate`, useful for value binding –
#607.

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

Closes #670
2025-01-14 08:58:05 +02:00
PThorpe92
abb3fda19f Fix all the flaky datetime tests 2025-01-13 19:51:34 -05:00
Levy A.
2f2c96fa2c chore: cargo fmt 2025-01-13 21:31:33 -03:00
Levy A.
eff5de50c5 refactor: make translate_* functions accept ProgramBuilder
simplifies function signatures and allows attaching more context to
ProgramStatus on `translate::translate`, useful for query parameters.
2025-01-13 20:41:56 -03:00
김선우
23d17dba25 Merge branch 'main' into java-limbo-connection 2025-01-14 07:35:09 +09:00
Jorge Hermo
df3123e128 Merge with main 2025-01-13 22:20:17 +01: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
2f90a06533 core/io/unix: replace O_NONBLOCK flag from libc with equivalent from rustix 2025-01-13 21:03:05 +01:00
Jorge López
5e9cb58f04 core/io/io_uring: remove unnecessary path prefix for log macros, and replace one unwrap with ? 2025-01-13 20:21:37 +01:00
Jorge López
b146f5d4cb core/io/io_uring: replace nix and libc calls with their rustix counterparts.
core: remove dependency on nix. We keep depending on libc, though, because crate io_uring requires libc's iovec.
2025-01-13 20:21:37 +01:00
Jorge López
b1e8f2da73 core/io/unix: minor formatting 2025-01-13 20:21:37 +01:00
Jorge López
7b5e5efd14 core/io/unix: replace libc calls and types with their rustix counterparts 2025-01-13 20:21:37 +01:00
Jorge López
7808665c92 core: make MAX_IOVECS u32 instead of usize, to match the type expected by io_uring 2025-01-13 20:21:37 +01:00
Jorge López
d4de451d45 core: enable rustix/io_uring with io_uring feature 2025-01-13 20:21:15 +01:00
Pekka Enberg
96148af331 Merge 'Fix 8-bit serial type to encoding' from Preston Thorpe
This PR fixes #666
Limbo was treating all single byte integers properly in `core/types.rs`,
but when converted in `sqlite3_ondisk`, it was losing the sign for 8 bit
integers, treating them all as unsigned. Sqlite3 specifies in their file
format that the `1` record serial type is "Value is an 8-bit twos-
complement integer."  https://www.sqlite.org/fileformat.html
We now properly match sqlite3's output
![image](https://github.com/user-attachments/assets/567960ca-
bfc6-4210-9a0e-ae4203a63add)
![image](https://github.com/user-
attachments/assets/ed4e709b-63ea-4de9-bbdc-a3f8b4dfd0f9)

Closes #667
2025-01-13 20:59:54 +02:00
Pekka Enberg
42293115de Merge 'cli: Introduce a selectable IO backend with --io={syscall,io-uring} argument' from Jorge López Tello
Give the user the option of choosing IO backend. There is only a
"syscall" backend, unless built for Linux with `#[cfg(feature =
"io_uring")]` which introduces `--io=io-uring`.
Right now, the choice has only been implemented for the CLI. Bindings
and such default to PlatformIO, except when an "in-memory" database has
been chosen.
Can be tested by running CLI with RUST_LOG=debug

Reviewed-by: Preston Thorpe <preston@unlockedlabs.org>

Closes #654
2025-01-13 20:59:20 +02:00
PThorpe92
0b6061de2f Adjust sqlite serial type to account for single byte signed integer 2025-01-13 13:34:46 -05:00
Pekka Enberg
481bd17219 Merge 'docs: add python bindings' from Jean Arhancet
Document Python binding setup with Maturin.

Closes #653
2025-01-13 19:06:39 +02:00
Pekka Enberg
44550ab749 cargo fmt 2025-01-13 18:58:40 +02:00
Pekka Enberg
c7ea2393b3 Merge 'Store cursor types in program state and remove trait Cursor' from Jussi Saurio
I was planning on starting work on index insertion, but realized we need
to know whether our cursor refers to a table or an index etc., so it
resulted in this refactoring work.
- `cursor_ref` now contains what _type_ of cursor it is (table, index,
pseudo, sorter)
- `program.cursors` is now `program.btree_table_cursors`,
`program.btree_index_cursors` etc and they are unboxed because dynamic
dispatch is no longer necessary
- Cursor trait removed -- 95% of the shit was btree specific anyway, so
I just moved them to `BTreeCursor`. In certain instructions in the VDBE
we expect a btree cursor and in others we expect a pseudo/sorter etc,
lets make that explicit.
- I also removed `BTreeCursor::get_new_rowid()` specific tests that
required macros to generate a mock implementation of the `Cursor` trait
-- main reason is I couldn't figure out how to reimplement this without
the trait, and the second reason is that I don't think we really need
those tests, AND the proc macro is constantly failing in my editor as
well and screwing up `rust-analyzer`

Closes #655
2025-01-13 18:40:46 +02:00
Pekka Enberg
8769bf82a5 Merge 'fix: flaky test in datetime because compare pre-init now.' from Sonny
Removed flaky test that happens sometimes when the CI runner is a bit
slow e.g. in https://github.com/tursodatabase/limbo/actions/runs/1270626
5753/job/35418879041?pr=643
'now' is covered in other test so it should be fine. it is a problem in
time test, for date not so much.
for example it is covered in:
https://github.com/tursodatabase/limbo/blob/bcc85c37a0febdf5c3f29127029f
e10c9906867d/core/vdbe/datetime.rs#L1434C5-L1446C6

Closes #652
2025-01-13 18:39:54 +02:00
Pekka Enberg
fa6a9ed214 Merge 'bindings/java: Fix naming rules' from Kim Seon Woo
## Purpose of this PR
- Set rules for java naming, maybe we can add tests to  automatically
test rules in the future
- For java methods, don't use underbar(IMO using camelcase for java
methods seems to be the common convention)
- If method names collide, append 0 at the back
## Reference
https://github.com/tursodatabase/limbo/issues/615

Closes #645
2025-01-13 18:39:24 +02:00
Pekka Enberg
9d42a48105 Merge 'Implement json_error_position' from Peter Sooley
Furthering work for JSON compatibility as described in #127, this change
adds support for the `json_error_position` function used to find the
error in invalid JSON values.
![image](https://github.com/user-attachments/assets/d61403ef-
bccf-41b0-9128-199066608fac)

Closes #564
2025-01-13 18:21:55 +02:00
Pekka Enberg
1e94dbffcc Merge branch 'main' into json-error-position 2025-01-13 18:21:37 +02:00
Jorge Hermo
016d9d17ab refactor: json functions vdbe 2025-01-13 00:05:14 +01:00
JeanArhancet
94ff7ac48c docs: add instructions for creating and using a Python virtual environment 2025-01-12 18:44:58 +01:00
Jorge López Tello
7365bee984 Merge branch 'tursodatabase:main' into selectable-io-backend 2025-01-12 15:11:54 +01:00