Skip to content

Commit

Permalink
0.0.4 (#5)
Browse files Browse the repository at this point in the history
* 0.0.3

* move commands to npm run, and fix readmes

* Update README.md

* clean up package.json

* 0.0.4
  • Loading branch information
aidenwallis committed Oct 16, 2022
1 parent 2d9c4e4 commit 765e841
Show file tree
Hide file tree
Showing 8 changed files with 86 additions and 2,624 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# kysely-d1

[![ci](https://github.com/aidenwallis/kysely-d1/actions/workflows/ci.yaml/badge.svg)](https://github.com/aidenwallis/kysely-d1/actions/workflows/ci.yaml)
[![npm](https://img.shields.io/npm/v/kysely-d1.svg)](https://www.npmjs.com/package/kysely-d1)

[Kysely](https://github.com/koskimas/kysely) adapter for [Cloudflare D1](https://blog.cloudflare.com/introducing-d1/).

```bash
npm install kysely-d1
npm i kysely-d1
```

An adapter for [Cloudflare D1](https://blog.cloudflare.com/introducing-d1/) using [Kysely](https://github.com/koskimas/kysely).

This project was largely adapted from [kysely-planetscale](https://github.com/depot/kysely-planetscale).

## Usage
Expand Down
8 changes: 4 additions & 4 deletions example/README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# example

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

## Setup

**First, create a D1 database:**

```bash
npx wrangler d1 create kysely-test
npm run create-db
```

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

```bash
npx wrangler d1 execute kysely-test --file ./setup.sql --local
npm run setup
```

## Running locally

After setup, run the project locally:

```bash
npx wrangler dev --local --persist
npm run start
```
14 changes: 7 additions & 7 deletions example/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@
},
"private": true,
"scripts": {
"start": "wrangler dev",
"create-db": "wrangler d1 create kysely-test",
"start": "wrangler dev --local --persist",
"setup": "wrangler d1 execute kysely-test --file ./setup.sql --local",
"deploy": "wrangler publish"
},
"dependencies": {
"kysely": "^0.22.0",
"kysely-d1": "^0.0.2"
"kysely-d1": "^0.0.4"
}
}
2 changes: 1 addition & 1 deletion example/wrangler.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name = "fuck-wrangler"
name = "kysely-d1"
main = "src/index.ts"
compatibility_date = "2022-10-16"

Expand Down
Loading

0 comments on commit 765e841

Please sign in to comment.