Skip to content

Latest commit

 

History

History

example

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

example

An example Kysely project using kysely-d1 and Cloudflare D1.

Setup

First, create a D1 database:

npm run create-db

Take note of the name and UUID of the database.

Then, update the binding in wrangler.toml to use your D1 database.

[[ d1_databases ]]
binding = "DB" # i.e. available in your Worker on env.DB
database_name = "kysely-test"
database_id = "<YOUR ID>"

Then, run the migration script:

npm run setup

Running locally

After setup, run the project locally:

npm run start