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.
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.
* 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>
* 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
* 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.
* libsql: Make encryption cipher configurable
Introduce a `EncryptionConfig` struct to configure both encrytion cipher
and key. Needed to support multiple ciphers.
Fixes#951
* libsql-ffi: Switch to SQLCipher as the default cipher
Fixes#893
* 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