Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tom-sherman/kysely-d1-api
So you can use kysely with d1 outside of cloudflare workers.
https://github.com/tom-sherman/kysely-d1-api
cloudflare-workers d1 deno sqlite
Last synced: 14 days ago
JSON representation
So you can use kysely with d1 outside of cloudflare workers.
- Host: GitHub
- URL: https://github.com/tom-sherman/kysely-d1-api
- Owner: tom-sherman
- Created: 2022-11-20T22:44:19.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2022-11-20T22:46:31.000Z (about 2 years ago)
- Last Synced: 2023-03-02T21:12:38.213Z (almost 2 years ago)
- Topics: cloudflare-workers, d1, deno, sqlite
- Language: TypeScript
- Homepage:
- Size: 2.93 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# kysely d1 api driver
So you can use kysely with d1 outside of cloudflare workers.
> **Warning**: This is just a proof of concept. See discussion at https://github.com/aidenwallis/kysely-d1/issues/7 for more info.
```ts
export interface BlogPostsTable {
Slug: ColumnType;
Title: ColumnType;
}interface Database {
BlogPosts: BlogPostsTable;
}const db = new Kysely({
dialect: new D1APIDialect({
accountId: D1_ACCOUNT_ID,
apiKey: D1_API_KEY,
databaseName: D1_DB_NAME,
}),
});const result = await db.selectFrom("BlogPosts").select("BlogPosts.Title")
.executeTakeFirstOrThrow();console.log(result);
```