Build web server with the #1 Fastest Framework, and Scale your Database with Turso.
1. Set Up Turso Credentials
- Signup at turso (optional if you already have an account)
turso auth signup
- Login to your turso cli
turso auth login
- create database
turso db create <database-name>
- get your
DATABASE_URL
turso db show --url <database-name>
- get your
DATABASE_TOKEN
turso db tokens create <database-name>
- update
.env
DATABASE_URL=libsql://[dbname]-[username].turso.io
DATABASE_TOKEN=your_token
2. Managing Migrations with `geni`
- export ENV
export DATABASE_URL=libsql://[dbname]-[username].turso.io
export DATABASE_TOKEN=[token]
- Create new Migration
geni new create_users_table
- Fill up your *.up.sql and *.down.sql schema
*.up.sql
CREATE TABLE users (
ID INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT
);
*.down.sql
DROP TABLE users;
- Run your migration (optional)
when we run our app it would automatically run the migration.
geni up