Commit Graph

22 Commits

Author SHA1 Message Date
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 79d27050a9 Update Rust dependencies. 2025-12-03 12:04:55 +01:00
Sebastian Jeltsch 7c06d60999 Update Rust dependencies. 2025-12-02 10:45:56 +01:00
Sebastian Jeltsch c35c2acc41 It's been a little over 6 weeks since v0.19 removing V8 from the trail binary. This change now removes the code.
I wasn't sure how long to keep the code around as an optional feature. However, the latest wasmtime release pins serde to a version, which is incompatible with the latest (somewhat stale) deno/V8/SWC dependencies. In other words, updating wasmtime right now would break the V8 build :/. The state of the rustyscript/deno dependency chain had certainly been one of the driving factors to move to WASM. While it feels validating, it's a little sad to see V8 go... but at the least we want to make the removal eplicit (as opposed to a broken build) with this change.
2025-11-23 22:17:03 +01:00
Sebastian Jeltsch 0c15272bae Fix: when installing WASM components using the CLI make sure <data_dir>/wasm exists. #179 2025-11-23 00:00:18 +01:00
Sebastian Jeltsch 1122206c0c Add a command to CLI to update all "first-party" components. 2025-11-20 11:36:11 +01:00
Sebastian Jeltsch c726e5fc76 Add a CLI command to list installed WASM components. 2025-11-20 11:36:02 +01:00
Sebastian Jeltsch 5809a600fd Version WASM component interface, break up into packages, and add a new API for custom SQLite functions. 2025-11-12 14:31:02 +01:00
Sebastian Jeltsch 8c55e406c8 Remove singleton json schema registry. 2025-11-11 13:16:37 +01:00
Sebastian Jeltsch 232a984bba Minor: have trail --version also display SQLite version. 2025-11-01 09:14:50 +01:00
Sebastian Jeltsch ebb24d022f Overhaul DB schema and JSON schema abstractions. Inject JSON schems registry explicitly, making our initialization order challenges more explicit too. 2025-11-01 01:47:52 +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 45312e94f4 Update Rust dependencies. 2025-10-14 14:38:57 +02:00
Sebastian Jeltsch 08bcf98e67 Disable V8 runtime by default (custom builds can still enable it) and add a truly static binary release for Linux using MUSL.
Building with MUSL required vendoring sqlite-vec and OpenSSL.

Also clean up no-longer-supported TypeScript guest scripts.
2025-10-07 20:47:28 +02:00
Sebastian Jeltsch ca5d257182 Forward v8 feature to CLI. 2025-09-25 23:01:18 +02:00
Sebastian Jeltsch 06feb8d180 Remove built-in auth ui in favor of component. To install the comoponentized auth-ui run trail components add trailbase/auth_ui. 2025-09-23 22:24:47 +02:00
Sebastian Jeltsch d3db3282b1 Add super basic WASM component management for first-party components (currently only auth-ui) to the CLI.
Something like this could involve into a plugin eco-system but that is a long way. Also this is not a package/dependency manager, there's no notion of transitivity etc.
2025-09-23 13:58:08 +02:00
Sebastian Jeltsch bd4cc18e84 Cleanup version handling. Parse out git version tag. 2025-09-23 12:24:07 +02:00
Sebastian Jeltsch 55149a1734 Add WASM host-runtime to TrailBase and rebrand relevant command-line flags. 2025-09-09 15:39:35 +02:00
Sebastian Jeltsch 71a314c931 Remove SWC spam suppression - newer versions are no longer affected. 2025-08-25 12:30:45 +02:00
Sebastian Jeltsch b7349dd91c Update Rust toolchain to latest stable: 1.89.0. 2025-08-10 17:48:14 +02:00
Sebastian Jeltsch 7a8c31c8e9 Cleanup: move all Rust code into a crates/ directory. 2025-08-07 10:02:32 +02:00