
Trailbase is a promising high-performance, single-binary backend written in RUST that provides a managed SQLite database with Auth, Realtime, and file storage. This library is a lightweight C driver designed for straightforward API, making it easy to port Trailbase integration to microcontrollers and embedded systems.
⚠️ Trailbase is currently unstable (DB corruption) therefore developing this client is paused. The Admin Gui for example show. Certain columns exist, but in the underlying database the collumns appear to be absent. Restarting the server helps but it makes development impractical.
This library enables C-based clients to authenticate against a Trailbase backend using its built-in Auth system. By verifying existing user credentials, you can log in directly from C to interact with your TrailBase database. The driver provides a streamlined way to read, write, and subscribe to updates from database, offering sub-millisecond ex. network response times.
Initially the user will log in with a username and a password beloging tot he TrailBase user and requests a JWT id token TrailBase will subequently return a response in json format containing; an id token and a refresh token.
An Authenticated user can listen for changes inside a database; insert, update, create, delete etc. In order to use this functionality you need to enable this functionality inside the Table, inside that admin ui of TrailBase Click on API inside the table view, en click enable Subscriptions.
You can insert a record with a json string. Obiously it be better to map a struct and generate a json from this struct before uploading it. If the insert was succesfull TrailBase will return a record ID for the record in that table.
Currently there is a very simply query protoype that allows you to select from a table and get values between within a certain range.