Skip to content

Add Drizzle beta v1 support#911

Open
ziahamza wants to merge 2 commits intopowersync-ja:mainfrom
ziahamza:drizzle-v1-beta
Open

Add Drizzle beta v1 support#911
ziahamza wants to merge 2 commits intopowersync-ja:mainfrom
ziahamza:drizzle-v1-beta

Conversation

@ziahamza
Copy link
Copy Markdown

@ziahamza ziahamza commented Mar 28, 2026

Summary

The PR adds support for Drizzle v1 beta relational queries through relations + db.query, while keeping the existing 0.44.x behavior intact and exposing db._query as an alias on the 0.44.x path.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 28, 2026

🦋 Changeset detected

Latest commit: 53924bf

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@powersync/drizzle-driver Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@ziahamza ziahamza changed the title [codex] add smaller Drizzle beta support Add Drizzle beta v1 support Mar 28, 2026
@Chriztiaan
Copy link
Copy Markdown
Contributor

Hey @ziahamza, firstly thank you for putting in the effort and making this PR. In terms of an official release, we would prefer to wait for the stable Drizzle 1.0.0 version and then only support that instead of keeping support for 0.x.x versions, to make adoption and maintenance easier on our side.

As an alternative, we could do dev releases off this PR and update it as changes from the upstream Drizzle project trickles down on the way to the v1 release. That would mean the work needed for this current PR includes a changeset entry, and potentially dropping all the backwards compatible code/documentation/tests you have added here. I suspect that might also simplify your implementation if you only had to worry about support v1 instead of backwards compatibility?

@ziahamza
Copy link
Copy Markdown
Author

Hey @ziahamza, firstly thank you for putting in the effort and making this PR. In terms of an official release, we would prefer to wait for the stable Drizzle 1.0.0 version and then only support that instead of keeping support for 0.x.x versions, to make adoption and maintenance easier on our side.

As an alternative, we could do dev releases off this PR and update it as changes from the upstream Drizzle project trickles down on the way to the v1 release. That would mean the work needed for this current PR includes a changeset entry, and potentially dropping all the backwards compatible code/documentation/tests you have added here. I suspect that might also simplify your implementation if you only had to worry about support v1 instead of backwards compatibility?

Yes it will indeed simplify things a lot if we go all into v1 and drop backward compat support! Let me prepare the dev release with the correct change set to get the dev release out for projects already migrating to drizzle v1 beta

paragraphs
};

export const drizzleRelations = defineRelations(drizzleSchema);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think there's a 1-many relationship missing in this change.

/**
* Nullify all nested objects from nullifyMap that are nullable
*/
function applyNullifyMap(
Copy link
Copy Markdown
Contributor

@Chriztiaan Chriztiaan Apr 14, 2026

Choose a reason for hiding this comment

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

A lot of jdoc comments were removed in this file?

@Chriztiaan
Copy link
Copy Markdown
Contributor

Hey @ziahamza. I have made a dev release for this drizzle package work under the following handle:
"@powersync/drizzle-driver":"0.0.0-dev-20260414110516"

I'll keep an eye on Drizzle releases in the near future, feel free to ping me here or on our Discord if you want to coordinate newer releases. Once again thanks a bunch for this work!

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