Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to latest D1 API #16

Merged
merged 6 commits into from
Feb 13, 2023

Conversation

tom-sherman
Copy link
Contributor

@tom-sherman tom-sherman commented Feb 3, 2023

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

Description

D1 API has changed: https://github.com/cloudflare/workerd/blob/42d45ba4cd41ed714b737a605a1022cc8d24cdde/types/defines/d1.d.ts#L1-L6

I have no idea if this is a bug or not lol

I also can't get this to work on the example project (can't get it to return the new result shape), which is leading me to think this is some sort of bug???? I am seeing the new shape in my Pages builds tho...

I'll leave this in draft for now while I hear wait to hear something in the cloudflare discord.

I had the wrong compat date and wrangler version lol

@tom-sherman tom-sherman marked this pull request as ready for review February 3, 2023 10:03
@tom-sherman
Copy link
Contributor Author

What really confused me is that there is a bug in wrangler pages dev right now that causes the old result shape to be returned locally but not when deployed. Raised that here: cloudflare/workers-sdk#2673

@aidenwallis
Copy link
Owner

I'm not sure, so is this broken or not? 👀 It sounds like you fixed the issue?

@tom-sherman
Copy link
Contributor Author

@aidenwallis haha the branch is now correct and is working, it targets the latest D1 API. Need to merge this PR to continue using D1 with Kysely 😄

@aidenwallis
Copy link
Owner

Ah got it, thanks

Copy link
Owner

@aidenwallis aidenwallis left a comment

Choose a reason for hiding this comment

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

just one question about the example change

@aidenwallis
Copy link
Owner

Also, this will be a major release (0.2.0), given we're changing the meta object structure changes and we don't provide fallbacks for the old version.

@tom-sherman
Copy link
Contributor Author

Sounds ok, I don't think there's any point maintaining backwards compatibility while D1 is in alpha.

@aidenwallis
Copy link
Owner

Thanks for the contribution! I'll cut a 0.2.0 release now.

@aidenwallis aidenwallis merged commit fb2ff7c into aidenwallis:main Feb 13, 2023
@aidenwallis
Copy link
Owner

Cut the release on NPM and Github: https://github.com/aidenwallis/kysely-d1/releases/tag/0.2.0

@tom-sherman tom-sherman deleted the update-to-latest-d1 branch February 13, 2023 12:49
adam-the pushed a commit to adam-the/kysely-d1 that referenced this pull request Aug 20, 2023
* Update to latest D1 API

* Bump compat date

* Use correct compat date 🤦‍♂️

* Update wrangler

* Add better error logging

* Revert DB ID and add preview
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.

2 participants