Commit graph

25 commits

Author SHA1 Message Date
Sebastian Jeltsch
847697c069 Fix WASM "ATTACH DATABASE" and sqlite error unpacking. #221 2026-04-07 14:09:26 +02:00
Sebastian Jeltsch
d65979766e Simplify the brokering logic and locking.
We should think about further ways to make message delivery async. There
may be implications with respect to event ordering :/.
2026-04-07 14:09:26 +02:00
Sebastian Jeltsch
9ecd7c11b7 Allow concurrent SELECTs from WASM guests, while still allowing the use of ATTACH/DETACH DATABASE. #221 2026-03-31 11:01:40 +02:00
Sebastian Jeltsch
ab6cf97e55 Major Rusqlite version update. 2026-03-16 13:01:08 +01:00
Sebastian Jeltsch
05d868cbeb Minor: clean up trailbase-sqlite's dependencies. 2026-02-24 09:42:40 +01:00
Sebastian Jeltsch
ff58546960 Fix benchmark build and simplify Cargo workspace seutp. 2026-02-21 15:38:30 +01:00
Sebastian Jeltsch
e3ea188d82 Add a join-order benchmark for SQLite. This isn't necessarily TB specific but can help us to quantify the limits and further optimize some of our settings. 2026-01-30 11:18:06 +01:00
Sebastian Jeltsch
401538963e Simplify WASM runtime integration. 2026-01-09 14:20:04 +01:00
Sebastian Jeltsch
1ba84437f1 Update rusqlite to v0.38 and vendor serde-rusqlite. 2026-01-05 22:09:06 +01:00
Sebastian Jeltsch
54115a9ad7 Release crate trailbase-qs v0.1.1 (and fix stale README references). 2026-01-05 22:07:59 +01:00
Sebastian Jeltsch
27ce368add Introduce a connection identiy and use it to manage subscriptions more robustely.
Ultimately names don't matter. Subscriptions only works if the update_hook is installed on the very connection the record APIs use for mutations.
2025-12-13 22:35:13 +01:00
Sebastian Jeltsch
84254e2fed Introduce multi-DB support, i.e. Record APIs can be powered by TABLEs/VIEWs from different DBs. This can help with physical isolation and offer a path forward when locking bottlenecks are encountered.
It's still early days, e.g. the UI doesn't yet support creating new DBs. However it allows exploring, creating and altering schemas for existing DBs. For now use the config to register new DBs.

Changes:

* Config-driven life-cycle management for "extra" DBs, i.e. creation and migration-management.
* Completely rewire connection & schema access throughout, now using a ConnectionManager abstraction.
* Update SubscriptionManager to track subscriptions across multiple DBs.
* Per-DB file management.
* Improved error handling.
* Basic e2e tests including file handling.
* Update UI:
  * Explorer: show, create and alteration of schemas on non-main DBs.
  * SQL Editor: allow control over which DBs are attached to the connection.

This change is breaking: it affects how migrations are loaded from `<traildepot>/migrations/<db>/` and switches transaction default of batch endpoint to false (cheaper).

This change does not introduce a notion of multi-tenancy, i.e. create a per-tenant/user DB on the fly based on templates and corresponding traffic routing.
2025-12-12 11:48:30 +01:00
Sebastian Jeltsch
7c06d60999 Update Rust dependencies. 2025-12-02 10:45:56 +01:00
Erin Power
01ebc71a15 chore: remove unused dependencies. #175 2025-11-17 10:38:53 +01:00
Sebastian Jeltsch
7fe146e1a5 Remove column schema assertions, which may be temporarily violated, e.g. when streaming in row-by-row during a scheme alteration. 2025-11-13 22:28:21 +01:00
Sebastian Jeltsch
8c55e406c8 Remove singleton json schema registry. 2025-11-11 13:16:37 +01:00
Sebastian Jeltsch
9e46a099d0 Stop encoding SQL values as generic JSON values (outside the context of the record API), i.e. for admin APIs and between WASM host/guest.
This lets us simplify the parsing and add back a lot of type-safety (including int64). As a side-effect, we basically had to complete reqrite the record insert/update handling in the admin UI.

Note, however, that this is a breaking change, since it touches serialization between WASM guests and host. Guest will need to be built against an updated guest runtime.
2025-10-21 16:40:45 +02:00
Sebastian Jeltsch
d94f491b81 Create a new unique filename for uploads {stem}_{rand#10}.{ext} in accordance with e.g. vite or PB. Use this as the primary way of accessing files. Having a filename extension may be useful for some consumers and having a unique name helps with content-caching strategies. #155
Also strip/hide uuid. Not really secret but we don't want folks to rely on it over the unique filename.
2025-09-26 14:19:18 +02:00
Sebastian Jeltsch
80519668ef Minor: address clippy lint issues. 2025-09-23 13:55:23 +02:00
Sebastian Jeltsch
07ecd4daf0 Simplify the acquisition of transaction locks in JS runtime. 2025-08-25 11:52:07 +02:00
Sebastian Jeltsch
bb91f3e11f Back-port tb-sqlite improvements: support for ArcLock, improve connectoin setup, and remove no longer needed add_preupdate_hook. 2025-08-25 11:35:26 +02:00
Sebastian Jeltsch
29d73d996d Add an experimental /api/transaction/v1/execute endpoint for mutating (create, update and delete) records across multiple APIs in a single transaction. #124
The endpoint is disabled by default and needs to be enabled in the configuration. Indepdently, the various client libraries do not yet support this new API.
2025-08-16 20:57:05 +02:00
Sebastian Jeltsch
b7349dd91c Update Rust toolchain to latest stable: 1.89.0. 2025-08-10 17:48:14 +02:00
Sebastian Jeltsch
b7695d12dd Fix cleanup of pending file deletions and add more tests. 2025-08-07 13:44:36 +02:00
Sebastian Jeltsch
7a8c31c8e9 Cleanup: move all Rust code into a crates/ directory. 2025-08-07 10:02:32 +02:00