Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
140 commits
Select commit Hold shift + click to select a range
f510359
Breaking change: Make Rows and Row API more consistent.
ignatz Aug 1, 2024
a68f042
libsql: release v0.5.0
LucioFranco Aug 2, 2024
0917f84
introduce NamespaceConfigurator
MarinPostma Aug 2, 2024
f9daa9e
add configurators to namespace store
MarinPostma Aug 2, 2024
8b377a6
add shcema configurator
MarinPostma Aug 3, 2024
978dd71
instanciate namesapces from configurators
MarinPostma Aug 3, 2024
907f2f9
pass configurators to NamespaceStore::new
MarinPostma Aug 5, 2024
fd03144
decoupled namespace configurators
MarinPostma Aug 5, 2024
0647711
legacy configurators
MarinPostma Aug 6, 2024
76558e8
fix behaviour of VACUUM for vector indices to make rowid consistent
sivukhin Aug 6, 2024
853143d
build bundles
sivukhin Aug 6, 2024
2115277
fix bug
sivukhin Aug 6, 2024
b12431c
configure durable wal
MarinPostma Aug 6, 2024
066f152
configure libsql_wal
MarinPostma Aug 6, 2024
b5dba72
partial implmentation of LibsqlWalReplicationConfigurator
MarinPostma Aug 6, 2024
ded5ba7
fmt + remove dbgs
MarinPostma Aug 6, 2024
e5b8c31
comment out libsql-wal replica configurator
MarinPostma Aug 6, 2024
6e7fb9f
restore encryption config
MarinPostma Aug 6, 2024
71c50e1
enable more windows CI
LucioFranco Aug 6, 2024
95be43c
Merge pull request #1642 from tursodatabase/lucio/windows-ci2
LucioFranco Aug 6, 2024
9d15ebf
Merge pull request #1641 from tursodatabase/vector-search-fix-vacuum
sivukhin Aug 6, 2024
07dc9b5
add LibsqlWalFooter
MarinPostma Aug 7, 2024
4069036
cancel query when request is dropped
MarinPostma Aug 7, 2024
5924766
write footer on checkpoint
MarinPostma Aug 7, 2024
d11ec01
downgrade debug to trace
MarinPostma Aug 7, 2024
fc178de
add query canceled metric
MarinPostma Aug 7, 2024
97652c1
Merge pull request #1628 from tursodatabase/lucio/0.5.0-libsql
LucioFranco Aug 7, 2024
351e6eb
add simple integration test
sivukhin Aug 7, 2024
3e56d28
fix potential crash in fts5
sivukhin Aug 7, 2024
7ed1468
build bundles
sivukhin Aug 7, 2024
0511ec3
Merge pull request #1643 from tursodatabase/libsql-footer
MarinPostma Aug 7, 2024
9595315
init cancel bomb berfore query exec
MarinPostma Aug 7, 2024
8db5ea8
Merge pull request #1644 from tursodatabase/query-cancel
MarinPostma Aug 7, 2024
0d41105
cargo fmt
sivukhin Aug 7, 2024
4085a0d
libsql: downgrade failed prefetch log to debug
LucioFranco Aug 7, 2024
dd80e69
Merge pull request #1646 from tursodatabase/lucio/downgrade-log
haaawk Aug 8, 2024
b0bc6eb
publish sqld debug builds to the separate image name
sivukhin Aug 8, 2024
5351b68
Merge pull request #1648 from tursodatabase/fix-debug-build-publish
MarinPostma Aug 8, 2024
51b1b49
remove digests artifacts from debug build step
sivukhin Aug 8, 2024
b97d37d
Merge pull request #1649 from tursodatabase/fix-debug-build-remove-di…
sivukhin Aug 8, 2024
9120ce6
Merge pull request #1623 from ignatz/align_row_and_rows
haaawk Aug 8, 2024
ec7bca5
Fix JSON f64 precision
wyhaya Aug 8, 2024
e7de104
Merge pull request #1645 from tursodatabase/fix-fts5-crash
sivukhin Aug 8, 2024
2c40df2
Merge pull request #1647 from wyhaya/main
haaawk Aug 8, 2024
5eeba43
improve random row selection
sivukhin Aug 8, 2024
4b3e7e7
fix random row selection query to have db name
sivukhin Aug 8, 2024
0b41b5a
build bundles
sivukhin Aug 8, 2024
f80444a
fix test
sivukhin Aug 8, 2024
83d029d
cleanup code a bit in order to simplify working with vector of differ…
sivukhin Aug 5, 2024
39e30ea
add 1bit vector type
sivukhin Aug 5, 2024
2e696fe
restructure search a bit in order to support compressed edges
sivukhin Aug 6, 2024
1a9cab9
1bit quantized embeddings search: somehow working version
sivukhin Aug 6, 2024
cd9cea3
move intrinsics to the utils
sivukhin Aug 6, 2024
eac5d90
move utils back to the vector1bit to simplify inlining for compiler
sivukhin Aug 8, 2024
0ec0147
extend binary format and store distance to edges in node blocks
sivukhin Aug 8, 2024
657ce07
fix comment a little bit
sivukhin Aug 8, 2024
11e6a93
add simple test
sivukhin Aug 8, 2024
93caa27
build bundles
sivukhin Aug 8, 2024
d66b138
Merge pull request #1651 from tursodatabase/vector-search-improve-ran…
sivukhin Aug 8, 2024
8441108
allow vector index to be partial
sivukhin Aug 8, 2024
ec996fa
build bundles
sivukhin Aug 8, 2024
e78fb34
Merge pull request #1632 from tursodatabase/libsql-wal-integration
MarinPostma Aug 9, 2024
85f1182
Document path based routing usage in multi tenant databases
avinassh Aug 9, 2024
ac6a89b
small fixes
sivukhin Aug 9, 2024
2aca12b
build bundles
sivukhin Aug 9, 2024
8077948
Merge pull request #1653 from tursodatabase/vector-search-allow-parti…
sivukhin Aug 9, 2024
7fe8f96
c: add replicated data for sync
LucioFranco Aug 2, 2024
fb85262
c: rename sync method to to avoid breaking change
LucioFranco Aug 6, 2024
7c4ea18
abstract replicator injector and introduce SqliteInjector
MarinPostma Aug 8, 2024
4b5baac
introduce libsql injector
MarinPostma Aug 8, 2024
566664e
fmt
MarinPostma Aug 8, 2024
a2bdc80
pass RpcFrame to client methods
MarinPostma Aug 8, 2024
e97026c
feature gate libsql injector
MarinPostma Aug 8, 2024
d29ca7f
fix conflicts
MarinPostma Aug 10, 2024
e4c2afc
Merge pull request #1652 from tursodatabase/libsql-wal-replicator
MarinPostma Aug 10, 2024
e7a2430
fix potential memory leak
sivukhin Aug 11, 2024
4c38e5f
build bundles
sivukhin Aug 11, 2024
8262d23
Merge pull request #1650 from tursodatabase/vector-search-compression
sivukhin Aug 11, 2024
9000742
add simple pragma test
sivukhin Aug 11, 2024
e8e5870
don't change idxType as sqlite rely on it pretty much
sivukhin Aug 11, 2024
b1dbaa1
build bundles
sivukhin Aug 11, 2024
a5db99b
Merge pull request #1659 from tursodatabase/vector-search-fix-idx-type
sivukhin Aug 11, 2024
cea8725
fix DELETE from vector index as there can be no row due to the NULL v…
sivukhin Aug 12, 2024
ac60c10
build bundles
sivukhin Aug 12, 2024
405c710
refine comment
sivukhin Aug 12, 2024
c135391
fix unstable test
sivukhin Aug 12, 2024
0f4531a
add support for vector indices over f64 embeddings
sivukhin Aug 12, 2024
626ff8c
prepare conversion function for mooore types
sivukhin Aug 12, 2024
4a57f02
add simple conversion test
sivukhin Aug 12, 2024
4b562ed
small refactoring
sivukhin Aug 12, 2024
181464f
add support for 1bit vector functions
sivukhin Aug 12, 2024
307139f
add conversion tests
sivukhin Aug 12, 2024
1216f17
remove unused function
sivukhin Aug 12, 2024
1a704d8
fix test
sivukhin Aug 12, 2024
e0035d6
add more tests
sivukhin Aug 12, 2024
51fc1da
build bundles
sivukhin Aug 12, 2024
30a198e
refine error messages
sivukhin Aug 12, 2024
66d374f
specify binary format for vectors in comment
sivukhin Aug 12, 2024
3c09fce
build bundles
sivukhin Aug 12, 2024
26c49a8
Merge pull request #1660 from tursodatabase/vector-search-fix-null
sivukhin Aug 12, 2024
1bd3262
Merge pull request #1629 from tursodatabase/lucio/update-c-bindings
LucioFranco Aug 12, 2024
2d325ba
windows compiler complains about operations with void* pointers
sivukhin Aug 12, 2024
4023a3a
Merge pull request #1662 from tursodatabase/fix-windows-build
sivukhin Aug 12, 2024
c75354e
generate uniform values from [-1..1] in benchmark workloads
sivukhin Aug 13, 2024
96d5ca9
fix formatting
sivukhin Aug 13, 2024
db15413
fix format specifier + build bundles
sivukhin Aug 13, 2024
7cafb80
use float1bit instead of 1bit everywhere in the code in index settings
sivukhin Aug 13, 2024
acafcc8
build bundles
sivukhin Aug 13, 2024
7a0fa8c
rename vector1bit.c -> vectorfloat1bit.c
sivukhin Aug 13, 2024
8604065
allow any neighbor compression types
sivukhin Aug 13, 2024
8a2a019
add implementation of float8 vector type (int8 quantization)
sivukhin Aug 13, 2024
244a34a
fix bug in cosine distance
sivukhin Aug 13, 2024
34c2974
support float8 neighbors compression
sivukhin Aug 13, 2024
562680c
add simple description of the float8 layout
sivukhin Aug 13, 2024
2e0647f
expose vector_distance_l2 func
sivukhin Aug 13, 2024
bd25344
add tests and refine error messages
sivukhin Aug 13, 2024
4303c65
build bundles
sivukhin Aug 13, 2024
7f8a069
libsql: release 0.5.1
LucioFranco Aug 13, 2024
3da2a8b
libsql: Add max_write_replication_index field to Database
haaawk Aug 13, 2024
8fb997e
libsql: Add max_write_replication_index method to Database
haaawk Aug 13, 2024
6c5193d
libsql: Add max_write_replication_index field to RemoteConnection
haaawk Aug 13, 2024
710ae01
libsql: Update max_write_replication_index after every write
haaawk Aug 13, 2024
75d04cf
libsql: Add Database::sync_until
haaawk Aug 13, 2024
2cf3494
tests: Add checks for max_write_replication_index
haaawk Aug 13, 2024
ef0ad61
Merge pull request #1665 from tursodatabase/replication_index
haaawk Aug 13, 2024
d86b5b7
Merge pull request #1666 from tursodatabase/lucio/0.5.1
LucioFranco Aug 13, 2024
fd1f5c4
Merge pull request #1661 from tursodatabase/vector-search-full-suppor…
sivukhin Aug 14, 2024
4fa2ce8
Merge pull request #1654 from avinassh/docs-path
avinassh Aug 15, 2024
045bef9
replace parking_lot with tokio::sync::Mutex in some places
sivukhin Aug 15, 2024
768998f
make check_program_auth async too
sivukhin Aug 15, 2024
47bf462
take conn lock before configs lock
sivukhin Aug 15, 2024
119dc57
expose basic tokio runtime metrics
sivukhin Aug 15, 2024
6ba85b4
Merge pull request #1668 from tursodatabase/use-tokio-sync-instead-of…
sivukhin Aug 15, 2024
0dcdb17
add tokio_unstable cfg in Cargo.toml and GH actions
sivukhin Aug 15, 2024
4ebff7f
remove feature
sivukhin Aug 15, 2024
f6fe40d
use single task to report bunch of metrics
sivukhin Aug 15, 2024
22d81ee
Merge pull request #1669 from tursodatabase/tokio-runtime-metrics
sivukhin Aug 16, 2024
f2271b0
Merge pull request #1664 from tursodatabase/vector-search-int8
sivukhin Aug 16, 2024
44cdde5
feat(libsql-server): send correct sse response
notrab Aug 16, 2024
d17a4f7
refactor and better group related code
notrab Aug 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/nemesis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
if: github.repository == 'tursodatabase/libsql'
name: Run Nemesis Tests
env:
RUSTFLAGS: -D warnings
RUSTFLAGS: -D warnings --cfg tokio_unstable
steps:
- uses: hecrj/setup-rust-action@v2

Expand Down
16 changes: 1 addition & 15 deletions .github/workflows/publish-server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,23 +118,9 @@ jobs:
context: .
platforms: ${{ env.platform }}
labels: ${{ steps.meta.outputs.labels }}
outputs: type=image,name=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }},push-by-digest=true,name-canonical=true,push=true
outputs: type=image,name=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-debug,push-by-digest=true,name-canonical=true,push=true
build-args: |
BUILD_DEBUG=true
-
name: Export digest
run: |
mkdir -p /tmp/digests
digest="${{ steps.build.outputs.digest }}"
touch "/tmp/digests/${digest#sha256:}"
-
name: Upload digest
uses: actions/upload-artifact@v4
with:
name: digests-debug-${{ env.PLATFORM_PAIR }}
path: /tmp/digests/*
if-no-files-found: error
retention-days: 1

build-arm64:
permissions: write-all
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
runs-on: ubuntu-latest
name: Run Checks
env:
RUSTFLAGS: -D warnings
RUSTFLAGS: -D warnings --cfg tokio_unstable
steps:
- uses: hecrj/setup-rust-action@v2

Expand Down Expand Up @@ -80,15 +80,15 @@ jobs:
- uses: taiki-e/install-action@cargo-udeps
- uses: Swatinem/rust-cache@v2
- run: cargo +nightly hack udeps -p libsql --each-feature
- run: RUSTFLAGS="-D warnings" cargo check -p libsql --no-default-features --features core
- run: RUSTFLAGS="-D warnings" cargo check -p libsql --no-default-features --features replication
- run: RUSTFLAGS="-D warnings" cargo check -p libsql --no-default-features --features remote
- run: RUSTFLAGS="-D warnings --cfg tokio_unstable" cargo check -p libsql --no-default-features --features core
- run: RUSTFLAGS="-D warnings --cfg tokio_unstable" cargo check -p libsql --no-default-features --features replication
- run: RUSTFLAGS="-D warnings --cfg tokio_unstable" cargo check -p libsql --no-default-features --features remote

test:
runs-on: ubuntu-latest
name: Run Tests
env:
RUSTFLAGS: -D warnings
RUSTFLAGS: -D warnings --cfg tokio_unstable
steps:
- uses: hecrj/setup-rust-action@v2

Expand Down Expand Up @@ -159,8 +159,8 @@ jobs:
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-
- name: check libsql remote
run: cargo check -p libsql --no-default-features -F remote
- name: build libsql all features
run: cargo build -p libsql --all-features

# test-rust-wasm:
# runs-on: ubuntu-latest
Expand Down
14 changes: 8 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ codegen-units = 1
panic = "unwind"

[workspace.dependencies]
rusqlite = { package = "libsql-rusqlite", path = "vendored/rusqlite", version = "0.31", default-features = false, features = [
rusqlite = { package = "libsql-rusqlite", path = "vendored/rusqlite", version = "0.32", default-features = false, features = [
"libsql-experimental",
"column_decltype",
"load_extension",
Expand All @@ -45,6 +45,7 @@ rusqlite = { package = "libsql-rusqlite", path = "vendored/rusqlite", version =
] }
hyper = { version = "0.14" }
tower = { version = "0.4.13" }
zerocopy = { version = "0.7.32", features = ["derive", "alloc"] }

# Config for 'cargo dist'
[workspace.metadata.dist]
Expand Down
7 changes: 7 additions & 0 deletions bindings/c/include/libsql.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ typedef struct libsql_stmt libsql_stmt;

typedef const libsql_database *libsql_database_t;

typedef struct {
int frame_no;
int frames_synced;
} replicated;

typedef struct {
const char *db_path;
const char *primary_url;
Expand Down Expand Up @@ -58,6 +63,8 @@ extern "C" {

int libsql_sync(libsql_database_t db, const char **out_err_msg);

int libsql_sync2(libsql_database_t db, replicated *out_replicated, const char **out_err_msg);

int libsql_open_sync(const char *db_path,
const char *primary_url,
const char *auth_token,
Expand Down
25 changes: 24 additions & 1 deletion bindings/c/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use tokio::runtime::Runtime;
use types::{
blob, libsql_connection, libsql_connection_t, libsql_database, libsql_database_t, libsql_row,
libsql_row_t, libsql_rows, libsql_rows_future_t, libsql_rows_t, libsql_stmt, libsql_stmt_t,
stmt,
replicated, stmt,
};

lazy_static! {
Expand Down Expand Up @@ -46,6 +46,29 @@ pub unsafe extern "C" fn libsql_sync(
}
}

#[no_mangle]
pub unsafe extern "C" fn libsql_sync2(
db: libsql_database_t,
out_replicated: *mut replicated,
out_err_msg: *mut *const std::ffi::c_char,
) -> std::ffi::c_int {
let db = db.get_ref();
match RT.block_on(db.sync()) {
Ok(replicated) => {
if !out_replicated.is_null() {
(*out_replicated).frame_no = replicated.frame_no().unwrap_or(0) as i32;
(*out_replicated).frames_synced = replicated.frames_synced() as i32;
}

0
}
Err(e) => {
set_err_msg(format!("Error syncing database: {e}"), out_err_msg);
1
}
}
}

#[no_mangle]
pub unsafe extern "C" fn libsql_open_sync(
db_path: *const std::ffi::c_char,
Expand Down
6 changes: 6 additions & 0 deletions bindings/c/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,12 @@ impl From<&mut libsql_connection> for libsql_connection_t {
}
}

#[repr(C)]
pub struct replicated {
pub frame_no: std::ffi::c_int,
pub frames_synced: std::ffi::c_int,
}

pub struct stmt {
pub stmt: libsql::Statement,
pub params: Vec<libsql::Value>,
Expand Down
15 changes: 11 additions & 4 deletions bottomless/src/replicator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ use aws_sdk_s3::primitives::ByteStream;
use aws_sdk_s3::{Client, Config};
use bytes::{Buf, Bytes};
use chrono::{DateTime, NaiveDateTime, TimeZone, Utc};
use libsql_replication::injector::Injector as _;
use libsql_replication::rpc::replication::Frame as RpcFrame;
use libsql_sys::{Cipher, EncryptionConfig};
use std::ops::Deref;
use std::path::{Path, PathBuf};
Expand Down Expand Up @@ -1449,12 +1451,13 @@ impl Replicator {
db_path: &Path,
) -> Result<bool> {
let encryption_config = self.encryption_config.clone();
let mut injector = libsql_replication::injector::Injector::new(
db_path,
let mut injector = libsql_replication::injector::SqliteInjector::new(
db_path.to_path_buf(),
4096,
libsql_sys::connection::NO_AUTOCHECKPOINT,
encryption_config,
)?;
)
.await?;
let prefix = format!("{}-{}/", self.db_name, generation);
let mut page_buf = {
let mut v = Vec::with_capacity(page_size);
Expand Down Expand Up @@ -1552,7 +1555,11 @@ impl Replicator {
},
page_buf.as_slice(),
);
injector.inject_frame(frame_to_inject)?;
let frame = RpcFrame {
data: frame_to_inject.bytes(),
timestamp: None,
};
injector.inject_frame(frame).await?;
applied_wal_frame = true;
}
}
Expand Down
6 changes: 6 additions & 0 deletions docs/USER_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,12 @@ For example, if you have the following entries in your `/etc/hosts` file:
You can access `db1` with the `http://db1.local:8080`URL and `db2` with `http://db2.local:8080`.
The database files for the databases are stored in `<data dir>/dbs/db1` and `<data dir/dbs/db2`, respectively.

### Path based routing

For local development and testing, you can also connect to your databases by specifying the database namespace in the URL path.

You can access namespace `db1` with the `http://local:8080/dev/db1` URL and `db2` with `http://local:8080/dev/db2`, respectively.

### Wildcard domain for development

If you don't feel like editing `/etc/hosts` each time you want to test a new namespace, you can use any domain
Expand Down
2 changes: 1 addition & 1 deletion libsql-ffi/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "libsql-ffi"
version = "0.3.0"
version = "0.4.0"
edition = "2021"
build = "build.rs"
license = "MIT"
Expand Down
Loading