Skip to content

Commit 765e841

Browse files
authored
0.0.4 (#5)
* 0.0.3 * move commands to npm run, and fix readmes * Update README.md * clean up package.json * 0.0.4
1 parent 2d9c4e4 commit 765e841

8 files changed

Lines changed: 86 additions & 2624 deletions

File tree

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
# kysely-d1
22

33
[![ci](https://github.com/aidenwallis/kysely-d1/actions/workflows/ci.yaml/badge.svg)](https://github.com/aidenwallis/kysely-d1/actions/workflows/ci.yaml)
4+
[![npm](https://img.shields.io/npm/v/kysely-d1.svg)](https://www.npmjs.com/package/kysely-d1)
5+
6+
[Kysely](https://github.com/koskimas/kysely) adapter for [Cloudflare D1](https://blog.cloudflare.com/introducing-d1/).
47

58
```bash
6-
npm install kysely-d1
9+
npm i kysely-d1
710
```
811

9-
An adapter for [Cloudflare D1](https://blog.cloudflare.com/introducing-d1/) using [Kysely](https://github.com/koskimas/kysely).
10-
1112
This project was largely adapted from [kysely-planetscale](https://github.com/depot/kysely-planetscale).
1213

1314
## Usage

example/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# example
22

3-
An example Kysely project using kysely-d1.
3+
An example Kysely project using [kysely-d1](https://github.com/aidenwallis/kysely-d1) and [Cloudflare D1](https://blog.cloudflare.com/introducing-d1/).
44

55
## Setup
66

77
**First, create a D1 database:**
88

99
```bash
10-
npx wrangler d1 create kysely-test
10+
npm run create-db
1111
```
1212

1313
Take note of the name and UUID of the database.
@@ -24,13 +24,13 @@ database_id = "<YOUR ID>"
2424
**Then, run the migration script:**
2525

2626
```bash
27-
npx wrangler d1 execute kysely-test --file ./setup.sql --local
27+
npm run setup
2828
```
2929

3030
## Running locally
3131

3232
After setup, run the project locally:
3333

3434
```bash
35-
npx wrangler dev --local --persist
35+
npm run start
3636
```

example/package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,13 @@
88
},
99
"private": true,
1010
"scripts": {
11-
"start": "wrangler dev",
11+
"create-db": "wrangler d1 create kysely-test",
12+
"start": "wrangler dev --local --persist",
13+
"setup": "wrangler d1 execute kysely-test --file ./setup.sql --local",
1214
"deploy": "wrangler publish"
1315
},
1416
"dependencies": {
1517
"kysely": "^0.22.0",
16-
"kysely-d1": "^0.0.2"
18+
"kysely-d1": "^0.0.4"
1719
}
1820
}

example/wrangler.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name = "fuck-wrangler"
1+
name = "kysely-d1"
22
main = "src/index.ts"
33
compatibility_date = "2022-10-16"
44

0 commit comments

Comments
 (0)