Commit Graph

2189 Commits

Author SHA1 Message Date
Pekka Enberg
53cb1ffe38 Merge 'update COMPAT matrix for journal_mod pragma' from Glauber Costa
it seems like it is supported now

Closes #809
2025-01-29 09:44:28 +02:00
Pekka Enberg
99c532bd7c Merge 'bindings/go: Avoid potentially expensive operations on prepare' from Glauber Costa
This simple patch makes sure we can operate with a reference to the
string instead of being forced to transform it to a string, and makes
sure that the Arc doesn't have to be cloned (which can be expensive in
multi-core systems).
This doesn't really make a large difference in benchmarks, given how
expensive Parse::new() is.

Reviewed-by: Preston Thorpe (@PThorpe92)

Closes #808
2025-01-29 09:43:54 +02:00
Pekka Enberg
dfbd1ae44d Merge 'Add quickcheck property tests for vector extension' from Jussi Saurio
Cursor helped me use the `quickcheck` APIs and also taught me things
about vectors, hope it didn't lie to me

Closes #806
2025-01-29 09:43:18 +02:00
Pekka Enberg
277f0e75cd Merge 'Initial pass on vector extension' from Pekka Enberg
This pull requests adds some libSQL vector extension functions such as
`vector()` and `vector_distance_cos()`, which can be used for exact
nearest neighbor search as follows:
```
limbo> SELECT embedding, vector_distance_cos(embedding, '[9, 9, 9]')
   ...> FROM movies ORDER BY vector_distance_cos(embedding, '[9, 9, 9]');
[4, 5, 6]|0.013072490692138672
[1, 2, 3]|0.07417994737625122
```
Note that libSQL also support approximate nearest neighbour search with
DiskANN indexing, which is something we eventually want to port to Limbo
as well.

Closes #798
2025-01-29 09:43:04 +02:00
Glauber Costa
cd58d6c37e update COMPAT matrix for journal_mod pragma
it seems like it is supported now
2025-01-28 14:04:23 -05:00
Glauber Costa
bf1cfe3a1d avoid potentially expensive operations on prepare, query, execute
This simple patch makes sure we can operate with a reference to the
string instead of being forced to transform it to a string, and makes
sure that the Arc doesn't have to be cloned (which can be expensive in
multi-core systems).

This doesn't really make a large difference in benchmarks, given how
expensive Parse::new() is.
2025-01-28 13:44:34 -05:00
Jussi Saurio
c950b177aa Add test for property: vector -> text -> vector produces an equal vector 2025-01-28 16:09:48 +02:00
Jussi Saurio
e01555467f Add quickcheck property tests for vector extension 2025-01-28 15:53:11 +02:00
Pekka Enberg
ac188808b6 Update README.md 2025-01-28 14:37:50 +02:00
Pekka Enberg
a9d2ef3878 Update COMPAT.md 2025-01-28 14:26:09 +02:00
Pekka Enberg
b9c89e79c2 testing: Add few TCL tests for vector extensions 2025-01-28 14:24:09 +02:00
Pekka Enberg
ee05ad172b core: Bundle vector extension by default 2025-01-28 14:24:09 +02:00
Pekka Enberg
9462426685 Vector extension functions
This patch adds some libSQL vector extension functions such as
`vector()` and `vector_distance_cos()`, which can be used for exact
nearest neighbor search as follows:

```
limbo> SELECT embedding, vector_distance_cos(embedding, '[9, 9, 9]')
   ...> FROM movies ORDER BY vector_distance_cos(embedding, '[9, 9, 9]');
[4, 5, 6]|0.013072490692138672
[1, 2, 3]|0.07417994737625122
```
2025-01-28 14:24:09 +02:00
Pekka Enberg
0eedea0bdb Merge 'Fix panic when double quoted strings are used for column names.' from Krishna Vishal
Now:
```sql
limbo> create table t (a,b,c); insert into t (a,b,c) values ("hello", 234, 432);
thread 'main' panicked at core/translate/expr.rs:1621:29:
internal error: entered unreachable code: Id should be resolved to a Column before translation
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
```
After fix:
```sql
limbo> create table t (a,b,c); insert into t (a,b,c) values ("hello", 234, 432);

  × Parse error: no such column: "hello" - should this be a string literal in single-quotes?

limbo>
```
Closes #800

Reviewed-by: Diego Reis (@diegoreis42)
Reviewed-by: Preston Thorpe (@PThorpe92)

Closes #801
2025-01-28 14:20:58 +02:00
Pekka Enberg
d164ad1035 Merge 'Improve docs' from Sonny
Improving docs
1. adding journaling modes in compat
2. reformat the tables in compat
3. adding ref resources for DST

Closes #804
2025-01-28 14:19:18 +02:00
Pekka Enberg
3baca19f75 Merge 'bindings/java: Implement close() for LimboStatement and LimboResultSet ' from Kim Seon Woo
## Purpose of this PR
- Implement `close()` method for `LimboStatement`(+`JDBC4Statement`) and
`LimboResultSet`(+ `JDBC4ResultSet`)
## Changes
- Add `consumeAll` method in `LimboResultSet`
- Implement `close()` methods
  - Because  `JDBC4Statement` has longer lifecycle in compared to
`LimboStatement`, we manage different `close` fields(`LimboStatement` is
created when first `execute` method is called on `JDBC4Statemenet`)
## Reference
- [Issue](https://github.com/tursodatabase/limbo/issues/615)

Closes #799
2025-01-28 14:18:01 +02:00
Pekka Enberg
810ad77951 Merge 'bindings/java: Add README.md for bindings/java' from Kim Seon Woo
## Purpose of thie PR
- Add README.md for bindings/java
## Reference
- https://github.com/tursodatabase/limbo/issues/615

Closes #802
2025-01-28 14:17:47 +02:00
sonhmai
f59379e0c9 fix wrong replacement in compat 2025-01-28 11:35:49 +07:00
sonhmai
d4e5f83932 add references for dst 2025-01-28 11:32:17 +07:00
sonhmai
fc4192362d add journaling modes to compat 2025-01-28 11:13:37 +07:00
김선우
55a7cd230e Add README.md for bindings/java 2025-01-28 10:48:44 +09:00
김선우
b17511b559 Fix test to use lighter query 2025-01-28 09:25:57 +09:00
김선우
a82c459ed0 Implement close on LimboStatement and JDBC4Statement independently 2025-01-28 09:20:07 +09:00
Krishna Vishal
61d60cf4b7 Fix panic when double quoted strings are used for column names in SQL statements. Double quoted strings are not supported in SQLite. Fixes https://github.com/tursodatabase/limbo/issues/800 2025-01-27 23:15:04 +05:30
Pekka Enberg
ad8e05b9a1 Merge 'bindings/java: Implement LimboConnection close() ' from Kim Seon Woo
## Purpose of thie PR
- Implement `close()` method for `LimboConnection` and `JDBC4Connection`
## Changes
- Instead of closing the database when closing connections, close the
connection instead
## References
- https://github.com/tursodatabase/limbo/issues/615

Closes #797
2025-01-27 14:51:04 +02:00
김선우
eeed305b07 Nit 2025-01-27 20:40:43 +09:00
김선우
c18418bed0 Nit 2025-01-27 20:35:11 +09:00
김선우
e48d7aa763 Add consumeAll method in LimboResultSet and let JDBC4Statement to use it 2025-01-27 20:31:37 +09:00
김선우
4dd2d1c64a Implement close() on LimboStatement 2025-01-27 20:20:10 +09:00
김선우
6252947232 Fix the logic on determining whether connection is closed 2025-01-27 19:49:10 +09:00
김선우
1125e51a59 Add test for close() 2025-01-27 19:19:34 +09:00
김선우
dae15ef0e3 Implement limbo close() 2025-01-27 19:15:02 +09:00
Pekka Enberg
ef6a1be335 Merge 'Enable static linking for 'built-in' extensions' from Preston Thorpe
This PR introduces the ability to build and link with an extension
library, enabling features like `uuid` to not have to be shipped as
independent libraries and loaded at runtime.
To build and link with an extension, you simply add it as a dependency
with the `static` feature, and call register_extension_static. in this
case, we feature flag that with `uuid`
```rust
    #[cfg(feature = "uuid")]
    pub fn register_uuid(&self) -> Result<(), String> {
        let ext_api = Box::new(self.build_limbo_ext());
        if unsafe { !limbo_uuid::register_extension_static(&ext_api).is_ok() } {
            return Err("Failed to register uuid extension".to_string());
        }
        Ok(())
    }
```
So fortunately wasm targets are no longer excluded from extensions, only
loading them at runtime for now

Closes #737
2025-01-27 09:49:48 +02:00
Pekka Enberg
e8600fa2a1 Merge branch 'main' into static 2025-01-27 09:49:34 +02:00
Pekka Enberg
5a1e1f690a Merge 'bindings/java: Log driver loading error' from Pekka Enberg
Reviewed-by: Kim Seon Woo (@seonWKim)

Closes #791
2025-01-27 09:09:03 +02:00
Pekka Enberg
6f93f290e1 bindings/java: Log driver loading error 2025-01-26 21:07:18 +02:00
Pekka Enberg
9b9d5f9b4c Merge 'bindings/go: Rename to Limbo' from Pekka Enberg
...we'll likely call this Turso eventually, but right now, let's keep
the code consistent.

Reviewed-by: Preston Thorpe (@PThorpe92)

Closes #790
2025-01-26 21:04:43 +02:00
Pekka Enberg
0918fc40d4 bindings/go: Rename to Limbo
...we'll likely call this Turso eventually, but right now, let's keep
the code consistent.
2025-01-26 20:58:10 +02:00
Pekka Enberg
4f1548d27b Merge 'bindings/java: Apply spotless formatting in bindings/java project ' from Kim Seon Woo
## Changes
- Add lint related commands in Makefile
- Apply spotless formatting
## Related
- [Issue](https://github.com/tursodatabase/limbo/issues/615)

Closes #783
2025-01-26 20:48:42 +02:00
Pekka Enberg
089e4e66eb Merge 'Implemented json_valid function' from Harin
Closes #789
2025-01-26 20:48:16 +02:00
Pekka Enberg
76e76ba404 Merge 'core: Remove database header from BTreeCursor' from Pekka Enberg
It's already in the pager so use it from there to reduce the size of the
`BTreeCursor` struct.

Closes #788
2025-01-26 20:48:03 +02:00
Harin
0903b9b019 Implemented JSON valid function 2025-01-26 23:35:47 +05:30
Pekka Enberg
983875c443 core: Remove database header from BTreeCursor
It's already in the pager so use it from there to reduce the size of the
`BTreeCursor` struct.
2025-01-26 16:48:12 +02:00
Pekka Enberg
359576d910 Merge 'core: Kill Rows wrapper struct' from Pekka Enberg
It's just an useless wrapper, kill it.

Closes #786
2025-01-26 16:40:51 +02:00
Pekka Enberg
7967cc5efc core: Kill Rows wrapper struct
It's just an useless wrapper, kill it.
2025-01-26 16:27:19 +02:00
Pekka Enberg
9f3b2dcc92 Merge 'Program state optimizations' from Jussi Saurio
Current micro-optimizations:
- store single data structure for cursors in programstate, not one for
every cursor type
- use vec for cursors instead of btreemap
- use knowledge of cursor amount to pre-allocate cursor vec capacity
- don't use resize in ::new() and ::reset(), instead populate directly
and reset by iterating over each elem (somehow this is faster)
- use bitfield for ended_coroutine instead of hashmap

Closes #782
2025-01-26 16:05:04 +02:00
Jussi Saurio
faa6d0c69d use vec for cursors, not map 2025-01-26 14:04:05 +02:00
Jussi Saurio
cdafc9033e ProgramState::registers - no resize 2025-01-26 13:56:09 +02:00
Jussi Saurio
b687cf66eb use bitfield for ended_coroutine 2025-01-26 13:12:47 +02:00
김선우
2212cc2a09 Apply lints 2025-01-26 20:04:57 +09:00