0
0
mirror of https://github.com/tursodatabase/libsql.git synced 2025-05-25 16:50:43 +00:00

133 Commits

Author SHA1 Message Date
78b90d5a37 Improve project package manifests 2025-03-20 12:04:37 +02:00
8d6ba10505 Retire native WAL
The native WAL code is not production ready and is currently not
maintained. Therefore, let's retire the code.
2025-03-18 20:15:18 +02:00
e2de2504b4 Revert "libsql: Wire up xCheckpointSeqCount"
This reverts commit bb7f011f79.
2025-01-23 13:01:39 +02:00
923cebf902 libsql-replication: Switch retry message to warn log level
If we fail to contact the primary, we return an error message. Let's
switch to warn log level to avoid scaring users.
2024-12-31 13:26:05 +02:00
bb7f011f79 libsql: Wire up xCheckpointSeqCount 2024-12-11 10:37:23 +02:00
61558b2a9e libsql-{sqlite3,ffi}: Add xReadFrameRaw() to the virtual WAL API
This adds a new xReadFrameRaw() function to the virtual WAL API, which
upper layers can use to fetch the full frame, including the page number,
that is useful for appending frames to a WAL.
2024-10-29 13:30:27 +02:00
3ac4aa1689 libsql-{sqlite3,ffi}: Add xFrameCount() to the virtual WAL API 2024-10-29 13:30:27 +02:00
2a5e204d84 move open logic to SharedWal 2024-10-10 10:24:22 +02:00
45c7462cd3 libsql: small release fixes 2024-09-20 17:34:12 -04:00
e90e92b379 Merge pull request from tursodatabase/lucio/v0.6.0
libsql: prepare v0.6.0 release
2024-09-20 20:01:12 +00:00
1de0aaa4d5 libsql: prepare v0.6.0 release 2024-09-20 15:36:46 -04:00
2fc60b879a Merge pull request from tursodatabase/lucio/resolve-solana-build
libsql: add `tls` feature
2024-09-20 18:03:22 +00:00
8918d29164 fmt 2024-09-04 10:58:06 +02:00
718b27c4a1 set durable frame_no upon injection 2024-09-04 10:58:04 +02:00
3eb819dbac fixup! add durable frame_no to proto 2024-09-04 10:58:04 +02:00
631dd815d9 pass durable frame_no to libsql-injector 2024-09-04 10:58:04 +02:00
d55408200b add durable frame_no to proto 2024-09-04 10:58:03 +02:00
8deac0fa9e introduce BoxReplicationService type
for dynamic replication service selection
2024-08-20 14:38:57 +02:00
3ea7eb9d7c add LibsqlInjector constructor 2024-08-20 14:38:56 +02:00
48fe492ba5 replicator: Add set_primary_handshake_retries
Signed-off-by: Piotr Jastrzebski <piotr@chiselstrike.com>
2024-08-19 10:48:23 +02:00
4d314512ad replicator: Fix comment on force_handshake
Signed-off-by: Piotr Jastrzebski <piotr@chiselstrike.com>
2024-08-19 10:47:50 +02:00
a0cfcb5a28 replicator: Add max_handshake_retries field
Signed-off-by: Piotr Jastrzebski <piotr@chiselstrike.com>
2024-08-19 10:47:16 +02:00
2f1d71d567 libsql: add tls feature
This adds a new `tls` feature that is enabled by default, if this
feature is disabled building a libsql connection will panic with a
message asking you to configure a http connector. This allows users to
bring their own http connector and more importantly their own TLS lib
with their own versions without needing to compile rustls which we use
by default.

This resolves solana-sdk >2 build issues with uses an older version of
`curve25519-dalek` that pings `zeroize` to `<1.4`. New versions of
`rustls` require `1.7` of `zeroize` thus causing issues when building
`rustls` for libsql with the `tls` feature.
2024-08-13 16:24:19 -04:00
d29ca7fabe fix conflicts 2024-08-10 12:21:01 +02:00
e97026c82d feature gate libsql injector 2024-08-10 09:46:07 +02:00
a2bdc80574 pass RpcFrame to client methods
necessary to pass different underlying frames
2024-08-10 09:46:07 +02:00
566664e9a0 fmt 2024-08-10 09:46:06 +02:00
4b5baacad5 introduce libsql injector 2024-08-10 09:45:36 +02:00
7c4ea18c75 abstract replicator injector and introduce SqliteInjector 2024-08-10 09:44:55 +02:00
a68f042914 libsql: release v0.5.0 2024-08-02 09:26:28 -07:00
1dd2cc9ce9 moved to frames_synced 2024-08-01 15:16:42 -07:00
49c6b452f2 change log level to debug for replicator logs () 2024-07-16 07:56:48 +00:00
15dca45139 Make PRAGMA synchronous configurable for a Namespace ()
* Make PRAGMA synchronous configurable for a Namespace

SQLite allows setting synchronous values to any four levels. This
patch provides an option to set the level for a namespace which will
be used for every connection. It defaults to `NORMAL`.

allowed values: https://www.sqlite.org/pragma.html#pragma_synchronous

e.g. to enable:

    curl -X POST http://sqld-admin-endpoint/v1/namespaces/<namespace>/config -H "Content-Type: application/json" -d '{"durability_mode": "strong"}' -v

* Make `durability_mode` field optional in proto

* Set `default` in the enum

Co-authored-by: ad hoc <postma.marin@protonmail.com>

---------

Co-authored-by: ad hoc <postma.marin@protonmail.com>
2024-07-10 09:34:29 +00:00
43ec7b378c libsql: prepare v0.4.0 release () 2024-06-11 14:27:13 +00:00
e37b644395 libsql-wal: SealedSegment ()
* add libsql-wal crate

* add error module

* segment module, header structs on helper functions

* sealed log

* add missing deps

* silence warnings

* segment list

* fmt

* fix lockfile

* fix bottomless because of conflict on cargo.lock

* document db size

* fix typo in comment

* fix proto
2024-04-26 11:10:54 +00:00
49e28c6911 Prepare release ()
Signed-off-by: Piotr Jastrzebski <piotr@chiselstrike.com>
2024-04-17 15:00:11 +00:00
d9182c5946 Preparing a rust sdk release ()
Signed-off-by: Piotr Jastrzebski <piotr@chiselstrike.com>
2024-04-17 13:27:30 +00:00
15fe600c40 update tonic to 0.11 () 2024-04-11 17:54:36 +00:00
724f6db925 libsql: fix malformed db and add test ()
* add malformed db test

* continue to debug output sql

* reduce sql

* reset connection on injection

* remove println in test

* address comments
2024-04-04 18:20:17 +00:00
ef446125f7 write queue ()
* introduce connection manager

* remove unused wal methods

* remove lock stealer

* Make use of ConnectionManager in LibsqlConnection

it now takes a W: WalWrap instead of a WalManager. This is because we
want to inject the connection manager at the bottom of the wal wrapping
chain.

* add missing deps

* turn ReplicationLogger into a WrapWal

* update spots to to pass wal wrapper instead of wal manager

* remove dbg

* fmt

* fix sqlite3 rust tests
2024-03-20 22:27:13 +00:00
e154693fbd Fixed typos in replicator ()
Some more typo fixes in comments and messages.
2024-03-12 10:26:59 +00:00
1158b506e4 libsql: prepare v0.3.0 release () 2024-03-07 12:57:53 +00:00
405f605705 libsql: prevent database overwrite misuse ()
Closes 
2024-03-07 11:59:46 +00:00
9dbf604843 libsql: prefix client_wal_index file ()
* libsql: prefix client_wal_index file

* remove create_dir_all
2024-03-04 12:43:39 +00:00
62275b5bc7 Parametrize namespace creation for shared schema db ()
* initial parameters for creation of shared schema db

* store shared schema config persistently

* add StmtKind::DDL and block DDL schema changes on databases using shared schema

* Revert "add StmtKind::DDL and block DDL schema changes on databases using shared schema"

This reverts commit 5a5c0d62c91d72151a1c92309d8746116c518ad5.
2024-02-20 14:21:55 +00:00
d2fcc25094 limit row size ()
* update proto

* limit row size
2024-02-20 12:45:24 +00:00
bdb526e459 replica wait when snapshot not found () 2024-02-19 18:34:00 +00:00
c4438e0897 Make encryption cipher configurable and switch default to SQLCipher ()
* libsql: Make encryption cipher configurable

Introduce a `EncryptionConfig` struct to configure both encrytion cipher
and key. Needed to support multiple ciphers.

Fixes 

* libsql-ffi: Switch to SQLCipher as the default cipher

Fixes 
2024-02-19 15:37:42 +00:00
eb7dadd6a0 libsql: attach databases from other namespaces as readonly ()
* libsql: attach databases from other namespaces as readonly

With this proof-of-concept patch, other namespaces hosted
on the same sqld machine can now be attached in readonly mode,
so that users can read from other databases when connected
to a particular one.

* connection: add allow_attach to config

Default is false, which means connections are blocked from attaching
databases. If allowed, colocated databases can be attached in readonly
mode.

Example:
→  attach another as another; select * from another.sqlite_master;
TYPE      NAME     TBL NAME     ROOTPAGE     SQL
table     t3       t3           2            CREATE TABLE t3(id)

* libsql,namespaces: add client-side ATTACH support

* attach: support ATTACH x AS y aliasing

We're going to need it, because the internal database names in sqld
are uuids, and we don't expect users to know or use them.

* attach: fix quoted db names

In libsql-server, raw db names are uuids that need to be quoted,
so that needs to be supported in the ATTACH layer.
As a bonus, "names" that are actually file system paths are refused
to prevent abuse.

* libsql-server: drop stray serde(default) from allow_attach

* libsql-replication: update proto files

* libsql-replication: regenerate protobuf

* tests: move attach to its own test

* libsql-replication: fix proto number after rebase
2024-02-14 10:41:45 +00:00
3022908784 Fix replication bug ()
fix replicatioon bug
2024-02-12 15:38:03 +00:00