Skip to content

Add API Dialect#12

Open
tom-sherman wants to merge 3 commits intoaidenwallis:mainfrom
tom-sherman:api-dialect
Open

Add API Dialect#12
tom-sherman wants to merge 3 commits intoaidenwallis:mainfrom
tom-sherman:api-dialect

Conversation

@tom-sherman
Copy link
Contributor

@tom-sherman tom-sherman commented Nov 21, 2022

  • I have verified my changes didn't break the example project.

Description

Closes #7

This PR adds a new dialect that allows you to Kysely and D1 outside of cloudflare workers eg. in Deno and Node.

Note
I'd recommend not squashing these changes as I've structured the commits to preserve the history/renaming of index.ts -> d1-dialect.ts

This is so that git can track the rename in preperation of adding an index.ts barrel module
This is in preperation for a seperate D1 API dialect
throw new Error('D1 Driver does not support streaming');
}
}
// Marked as unstable as the D1 HTTP API is currently undocumented and may change.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the API is undocumented, I likely will not add support for this until Cloudflare formally document it. 👍

@aidenwallis
Copy link
Owner

@tom-sherman I'm thinking we should maybe consider closing this PR branch until there's official API support for this from Cloudflare.

We can keep an issue open to track this, if that works for you! 👍

@aidenwallis
Copy link
Owner

Did this API ever get documented?

@adam-the
Copy link

I think that it could be worthwhile adding this, even if the APIs aren't documented yet. In their Discord server, Cloudflare has committed to eventually documenting/stabilising the API and even endorse projects made around it such as this one: https://github.com/isaac-mcfadyen/d1-console

Accepting this pull request will allow for easier access for those who wish to experiment with it and enable anyone to submit maintenance changes for the feature in this project going forward.

return databases;
}

async databseFromName(name: string) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

*database

@waynesbrain
Copy link

This API is now documented - https://developers.cloudflare.com/api/resources/d1/

Has anyone put together a fork with some of these pull requests included? I had to fork this to an internal lib because the ESM compat pull request was never released to NPM and it was causing the whole CJS release of Kysely to be bundled.

@aidenwallis
Copy link
Owner

I'm sorry for abandoning this project. I've been really busy and stretched thin with many real life priorities, but still doesn't excuse the lack of communication here!

So, two things:

  1. Let me try to get you a good release on NPM with the ESM support.
  2. I am looking for someone to take over maintaining this to give it the love it deserves.

@waynesbrain
Copy link

@aidenwallis No problem, thanks for all the code!

I was able to cobble together all the pull requests to get what I wanted into a coherent package. It needs some tests for sure, but I'm practicing with using AI to generate stuff like that so it shouldn't be too much work.

If you want to add me as a maintainer or transfer the repo I'll be glad to start making new releases.

@aidenwallis
Copy link
Owner

@waynesbrain If you can prepare a PR, I'm happy to review and merge it if it's available sometime by next weekend, and cut a new release.

I'm a little hesitant to give maintainer access to a popular package to someone that isn't a part of Cloudflare or Kysely - but, if you want to spin up a fresh branch with the changes you have in mind while addressing some other issues, I can get them released for the time being!

@waynesbrain
Copy link

Thanks @aidenwallis I understand completely. All of the stuff I put together was from existing pull requests, so done! 🤣

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

D1 API dialect

4 participants