4 ms·
What are you using to manage your schema? Do you use an ORM? Maybe something like PocketBase[0]? [0]https://pocketbase.io/ https://pocketbase.io/
by haolez 4y ago
What are you using to manage your schema? Do you use an ORM? Maybe something like PocketBase[0]?
[0]https://pocketbase.io/ https://pocketbase.io/
- matthewfcarlson 4y agoI looked at pocketbase and other tools, but decided to keep it simple. Like GP, I'm also using D1 (https://developers.cloudflare.com/d1 https://developers.cloudflare.com/d1) which is based on SQLite and still in early Alpha. In combination with KV (https://developers.cloudflare.com/workers/learning/how-kv-works/ https://developers.cloudflare.com/workers/learning/how-kv-wo...) it's trivial to have a great database layer with caching using kysely (https://github.com/aidenwallis/kysely-d1 https://github.com/aidenwallis/kysely-d1) and trpc (https://trpc.io https://trpc.io) you can have typing from DB to front end.
- r3trohack3r 4y agoNope. Just have a directory: ./sql/0001_create_users.sql ./sql/0002_create_sessions.sql .... Each query for modifying the schema is idempotent and safe to be rerun. Then I do: ls ./sql | xargs -I{} wrangler d1 execute <db> --file {} Can put that in a script to make things easy. You use the same script to modify the db as you do to bootstrap a db from scratch.