0
0
mirror of https://github.com/tursodatabase/libsql.git synced 2025-08-11 23:12:52 +00:00
Commit Graph

16 Commits

Author SHA1 Message Date
ad hoc
2b06b6b7d8 schema migration (#1110)
happy path schema migration
2024-03-04 13:15:29 +00:00
Piotr Sarna
eb7dadd6a0 libsql: attach databases from other namespaces as readonly (#784)
* 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
Lucio Franco
954029e31f libsql: add Builder to construct the db (#993)
This adds a new `Builder` type that can now be used to construct the
`Database` type. This will scale better as we add more varied options.
This commit also deprecates the old builder types and will produce a
warning that will push users to using the new `Builder` type. This will
then allow us to remove the old deprecated constructors at some point in
the future.
2024-02-06 13:59:11 +00:00
Piotr Sarna
ce3da312df namespaces: more quoting fixes 2024-01-19 08:22:57 +01:00
Bartosz Sypytkowski
67678167ed changed RowsInner API to make next row method async 2024-01-16 08:23:08 +01:00
ad hoc
d1ad860288 Merge pull request #875 from tursodatabase/lucio/config
server: add replicated db config
2024-01-10 13:55:41 +00:00
Bartosz Sypytkowski
f97a82e9f8 fixing namespaces::delete_namespace uncovers a bug 2024-01-10 07:03:56 +01:00
Lucio Franco
20df3a18e5 server: add replicated db config 2024-01-09 16:19:30 -05:00
Lucio Franco
b1da52c722 server: Add initial MetaStore
This PR adds a new internal metadata store for namespace configuration.
This internally uses a normal namespace so that the replica also get's
synchronized. This is just initial work there are a few more issues to
solve regarding replica's getting updated configs and some internal
hardening that needs to be done. Tracking issue for follow up work #768.

Closes #501
2023-12-12 10:38:45 -05:00
Ashley Williams
536ce5095c rename(pkg): rename lib to libsql-server, keep bin as sqld 2023-11-17 08:43:05 -06:00
ad hoc
86b0328254 add test snapshot files 2023-10-31 17:10:59 +01:00
Lucio Franco
736d077e36 join simulation test creation 2023-10-31 09:22:30 -04:00
ad hoc
5d9fd529fc use abstract Replicator in libsql-server 2023-10-30 17:26:17 +01:00
ad hoc
4879f4ccc2 Revert "Revert "Same-thread frame injection (#695)" (#775)"
This reverts commit 85b3358a4d.
2023-10-30 17:25:28 +01:00
ad hoc
f15800793a re-enable embedded replica tests 2023-10-19 09:11:25 +02:00
ad hoc
71ca43a7b6 make sqld compile 2023-10-17 17:41:26 +02:00