Seed and query your local D1 database

local dev

// what it does

Loads a schema/seed .sql file into the local D1 instance and runs ad-hoc queries against it, so wrangler dev has real tables to read. This is how you stand up a working local DB before touching anything remote.

// shell

$ wrangler d1 execute <name> --local --file=./schema.sql
$ wrangler d1 execute <name> --local --command "SELECT * FROM users LIMIT 5"

// gotcha

Add --remote to hit production — but note the local DB lives under .wrangler/state (or --persist-to) and is completely separate from the remote copy, so seeds applied locally never appear in prod.