Load a schema or seed SQL file into D1
d1 & hyperdrive
// what it does
Ingest an entire .sql file — table DDL, seed data, or a hand-written data fix — in one shot. Common right after d1 create to bootstrap tables, or to seed a fresh remote database. Multiple statements in --command can be separated with ';'.
// shell
$ wrangler d1 execute <database> --file ./schema.sql --remote// gotcha
Local and remote are completely separate databases; running --file without --remote leaves production untouched. For changes you need to repeat across environments, use migrations instead of re-running raw files.