Define Drizzle schema in your EdgeSpark repo, generate migrations, and query your Cloudflare D1 database with the runtime SDK.
Every EdgeSpark project includes a Cloudflare D1 database. You define your app tables in server/src/defs/db_schema.ts, generate migrations with the CLI, and query the database from the runtime SDK.
edgespark db generate --name add_postsedgespark db checkedgespark db studio
Use edgespark pull schema only for platform-managed tables that EdgeSpark generates into server/src/__generated__/. Your app tables live in server/src/defs/ and use the migration workflow above.
Runtime DDL is blocked. Do not use edgespark db sql for CREATE TABLE, ALTER TABLE, or DROP TABLE. Apply schema changes through edgespark db generate and edgespark db migrate.
Transactions are not available. Use db.batch([...]) for atomic multi-step operations, and see platform limits whenever you are working near database or bundle constraints.