The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 06:00 UTC
| 1 | import * as Drizzle from "@alchemy.run/drizzle"; |
| 2 | import * as Turso from "@alchemy.run/turso"; |
| 3 | import * as Effect from "effect/Effect"; |
| 4 | |
| 5 | /** Every tenant database lives in this group. */ |
| 6 | export const Tenants = Turso.Group("Tenants", { location: "aws-us-east-1" }); |
| 7 | |
| 8 | /** |
| 9 | * A migrated, empty database. New tenants are forked from it, so each one |
| 10 | * starts with the current schema. |
| 11 | */ |
| 12 | export const Template = Effect.gen(function* () { |
| 13 | const group = yield* Tenants; |
| 14 | const schema = yield* Drizzle.Schema("NotesSchema", { |
| 15 | schema: "./src/schema.ts", |
| 16 | out: "./migrations", |
| 17 | dialect: "sqlite", |
| 18 | }); |
| 19 | return yield* Turso.Database("Template", { |
| 20 | group: group.name, |
| 21 | migrations: schema, |
| 22 | }); |
| 23 | }); |