Sebastian Jeltsch 6cbea390fb Herculean migration from libsql's rust bindings to plain rusqlite+SQLite.
There's a couple of reasons:

* As for the rust bindings: they're sub-par to rusqlite, though
  rusqlite is amazing. Even libsql-server uses rusqlite over their own
  bindings. The bindings are missing features such as update hooks
  and the hard-coded execution model suffers from lock congestion.
* We've fixed bugs (e.g. trivial null ptr accesses went unnoticed),
  raised issues, and tried to add missing functionality such as update
  hooks. It's unclear if the rust-bindings are a priority or covered by
  the principles laid out in the libsql manifesto. From the outside it
  looks like focus has shifted to https://github.com/penberg/limbo.
* As for the C-libsql fork for SQLite itself, it's getting more and
  more outdated (2024-01-30 (3.45.1)) and it's unclear when and if the
  ideas from the manifesto will manifest.

Looking forward this opens the door for TrailBase to:

* Bundle more recent versions of SQLite
* Implement more performant, better scaling execution models.
* Implement realtime APIs for subscribing to data changes.
2024-12-04 13:03:06 +01:00
2024-11-28 00:39:36 +01:00
2024-11-25 11:56:36 +01:00
2024-11-28 14:12:34 +01:00

TrailBase logo

A blazingly fast, single-file, open-source application server with type-safe APIs, built-in JS/ES6/TS Runtime, Auth, and Admin UI built on Rust+SQLite+V8.

Build Status License - OSL 3.0 Status - Alpha

TrailBase

Admin UI

Try the demo online - Email: admin@localhost, password: secret.

For more context, documentation, and an online live demo, check out our website trailbase.io. Questions? Thoughts? Check out the FAQ on our website or reach out. If you like TrailBase or its prospect, consider leaving a 🙏.

Project Structure & Releases

This repository contains all components that make up TrailBase including client libraries, tests, documentation and examples. Only the benchmarks are kept separately due to their external dependencies.

Pre-built static binaries are available as GitHub releases for Linux an MacOS.

Moreover, client packages and containers are available via:

Running

You can run pre-built TrailBase either by downloading the latest release and running

$ ./trail run

or using docker:

$ mkdir traildepot
$ alias trail="docker run -p 4000:4000 --mount type=bind,source=$PWD/traildepot,target=/app/traildepot trailbase/trailbase /app/trail"
$ trail run

. Run trail --help to get a full list of commands. If you don't want to rely on pre-built binaries, TrailBase is easy to build yourself, see below.

Building

If you have all the necessary dependencies (rust, nodejs, pnpm, ...) installed, you can build TrailBase simply by running:

$ git submodule update --init --recursive
$ cargo build --release

To build fully static binaries on Linux (et al):

$ RUSTFLAGS="-C target-feature=+crt-static" cargo build --target x86_64-unknown-linux-gnu --release

Alternatively, if you want a container or don't have to deal with dependencies, you can build using docker:

$ git submodule update --init --recursive
$ docker build . -t trailbase

Contributing

Contributions are very much appreciated 🙏. For anything beyond bug fixes, let's quickly chat to see how a proposal fits into the overall roadmap and avoid any surprises.

We're not sure yet what the best setup or exact license is for compatibility between OSL-3.0 and more popular licenses or use as a framework. So we'd ask you to sign a simple CLA that retains your copyright, ensures that TrailBase will continue to forever be freely available under an OSI-approved copyleft license, while allowing for some flexibility and sub-licensing as established by much larger, successful projects such as Grafana or Element.

License

TrailBase is free software under the terms of the OSL-3.0.

We chose this license over more popular, similar copyleft licenses such as AGPLv3 due to its narrower definition of derivative work that only covers modifications to TrailBase itself. This is similar to GPL's classpath exception or LGPL's linkage exception allowing the use of TrailBase as a framework without inflicting licensing requirements on original work layered on top. That said, we ain't lawyers. The author of the license provides a more thorough explanation. If you have any concerns or advice for us, please reach out.

If you require an exception, reach out to contact@trailbase.io.

Description
A blazingly fast, open-source application server with type-safe APIs, built-in JS/ES6/TS runtime, realtime, auth, and admin UI built on Rust, SQLite & V8.
Readme OSL-3.0 43 MiB
Languages
Rust 53.3%
TypeScript 36.8%
C# 1.9%
Dart 1.5%
Python 0.9%
Other 5.5%