一覧へ戻る
kristianfreeman/cloudflare-d1-prisma-honox-starter(新しいタブで開きます)
主要言語: TypeScript
cloudflare-d1-prisma-honox-starter
- star 数
- 95
- watcher 数
- 5
- fork 数
- 12
- issue 数
- 2
- 最終更新
- 2024/10/26
主要言語: TypeScript
cloudflare-d1-prisma-honox-starter
A starter project showing how you can integrate Prisma and Cloudflare D1 with a HonoX application to build awesome full-stack apps.
Tip
If the above paragraph was a bunch of buzzwords that seem confusing, here's the simple version:
$ git clone https://github.com/kristianfreeman/cloudflare-d1-prisma-honox-starter starter
$ cd starter
$ npm installwrangler.toml.example file to wrangler.toml and fill in the necessary values:$ cp wrangler.toml.example wrangler.toml
$APP_NAME with your Cloudflare Workers application name$CURRENT_DATE with the current date like this 2022-01-01$ npx wrangler d1 create <your-database-name>
Note that if you haven't yet used Wrangler, you will be prompted to log in to Cloudflare.
Copy the output of this command, which is structured TOML configuration, into your wrangler.toml.
d1 migrations subcommand:$ npx wrangler d1 migrations create <your-database-name> create_tables
$ npx prisma migrate diff \ --from-empty \ --to-schema-datamodel ./prisma/schema.prisma \ --script \ --output migrations/0001_create_tables.sql
$ npx prisma generate
$ npx wrangler d1 migrations apply <your-database-name>
$ npm run deploy
$ npx wrangler d1 migrations apply <your-database-name> --remote