Databases
Databases in Prezel require no configuration. All you have to do to get a database setup is pointing to their url. Prezel sets up a number of environment variables so you can point to them:
- LibSQL:
PREZEL_LIBSQL_URL
PREZEL_LIBSQL_AUTH_TOKEN
- Postgres (this is still a work in progress and will be available soon):
PREZEL_POSTGRES_URL
This means that if your app sends a request to PREZEL_LIBSQL_URL
, a LibSQL database will be created for your app, as simple as this.
Also, the same way as with app containers, database services scale to zero, which means that they will be stoped when idle and get back online when new requests arrive.
Of course, the storage of the production database will be preserved.
What’s more, database branching is on by default. This means every time you create a preview deployment by raising a pull request on Github, your production database will be cloned. This way, you will be able to test your changes against your production database, while being completely safe because you are simply working with a clone.
Especial mention: Astro DB
If you deploy an Astro app making use of Astro DB, this will be setup automatically with no extra configuration.
Prezel will setup the env variables ASTRO_DB_REMOTE_URL
and ASTRO_DB_APP_TOKEN
appropriately.