Commit Graph

1840 Commits

Author SHA1 Message Date
Kould
1bf651bd37 chore: rollback using rowid(sqlite3 unsupported) 2025-01-14 22:56:49 +08:00
Kould
5305a9d0fd feat: support keyword rowid 2025-01-14 22:41:40 +08:00
Pekka Enberg
55e79a72c1 Merge 'Initial pass on loadable rust extensions' from Preston Thorpe
This PR adds the start of an implementation of an extension library for
`limbo` so users can write extensions in rust, that can be loaded at
runtime with the `.load` cli command.
The existing "ExtensionFunc"  `uuid`, has been replaced with the first
complete limbo extension in `extensions/uuid`
![image](https://github.com/user-
attachments/assets/63aa06cc-9390-4277-ba09-3a9be5524535)
![image](https://github.com/user-
attachments/assets/75899748-5e26-406a-84ee-26063383afeb)
There is still considerable work to do on this, as this only implements
scalar functions, but this PR is already plenty big enough.
Design + implementation comments or suggestions would be appreciated
👍
I tried out using `abi_stable`, so that trait objects and other goodies
could be used across FFI bounds, but to be honest I didn't find it too
much better than this. I personally haven't done a whole lot with FFI,
or anything at all linking dynamically in Rust, so if there is something
I seem to be missing here, please let me know.
I added some tests, similar to how shell-tests are setup.
If anyone can test this on other platforms, that would be helpful as
well as I am limited to x86_64 linux here

Closes #658
2025-01-14 15:36:56 +02:00
PThorpe92
9c208dc866 Add tests for first extension 2025-01-14 07:27:35 -05:00
PThorpe92
e4ce6402eb Remove previous uuid implementation 2025-01-14 07:20:50 -05:00
PThorpe92
3099e5c9ba Improve api, standardize conversions between types, finish extension 2025-01-14 07:20:50 -05:00
PThorpe92
6e05258d36 Add safety comments and clean up extension types 2025-01-14 07:20:50 -05:00
PThorpe92
98eff6cf7a Enable passing arguments to external functions 2025-01-14 07:20:50 -05:00
PThorpe92
852817c9ff Have args macro in extension take a range 2025-01-14 07:20:50 -05:00
PThorpe92
c565fba195 Adjust types in extension API 2025-01-14 07:20:49 -05: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
Pekka Enberg
bfbaa80bdc Merge 'Change bindings/java to support java 8' from Kim Seon Woo
## Purpose of this PR
Change java bindings support from jdk version 17 to 8.
## Changes
- Mostly related to dependency version updates
- Replace java 8 non supported methods
## Reference
https://github.com/tursodatabase/limbo/issues/615

Closes #678
2025-01-14 14:17:39 +02:00
Pekka Enberg
537aea590f Merge 'Clean up license management ' from Kim Seon Woo
## Purpose of this PR
- Set up on how to manage licenses in limbo project
## Changes
- Move all licenses under `licenses` directory in the root path
- Add `NOTICE.md`
- Update `CONTRIBUTING.md` to explain how to add licenses to project
## Reference
https://github.com/tursodatabase/limbo/issues/615

Closes #677
2025-01-14 14:15:53 +02:00
Pekka Enberg
e6d389e89c Merge 'v2 of Consolidate libc implementations' from Jorge López Tello
This adds the missing parts of #668 which was just making the locks non-
blocking so they fail right away on conflict. Rustix was not very clear
on that, and the doc for `fcntl` didn't mention it, it was in the docs
for `flock`.
I have checked that this doesn't hang the test (🤦‍♂️).

Closes #676
2025-01-14 14:14:56 +02:00
김선우
b3883d03d6 Apply necessary changes for java 8 2025-01-14 20:14:32 +09:00
김선우
eacd7b7945 Change bindings/java to support java 8 2025-01-14 20:08:13 +09:00
김선우
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
Jorge López
a16282ea62 core: remove nix as a dependency 2025-01-14 11:06:13 +01:00
Jorge López
55e06b0c72 core/io: make file locks non-blocking so they fail right away 2025-01-14 11:01:11 +01: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