-
Notifications
You must be signed in to change notification settings - Fork 26
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
feat: Converting Drizzle tables to Powersync tables #408
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
🦋 Changeset detectedLatest commit: 3f4f471 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
Using getTableConfig instead of iterating keys.
# Conflicts: # packages/drizzle-driver/src/index.ts
Chriztiaan
force-pushed
the
feat/drizzle-schema
branch
from
November 15, 2024 14:57
2e8a768
to
dadddfd
Compare
Chriztiaan
changed the title
poc: Converting Drizzle tables to Powersync tables
feat: Converting Drizzle tables to Powersync tables
Nov 27, 2024
…nc-js into feat/drizzle-schema
# Conflicts: # packages/drizzle-driver/src/index.ts
stevensJourney
approved these changes
Dec 2, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
With the current Drizzle integration users need to maintain two table schema definitions (one for Drizzle and one for PowerSync). The initial idea was to infer a Drizzle schema from the PowerSync schema, but based on feedback and some testing it's clear that a Drizzle schema can be more complex and extensive (for example it supports relations) than a PowerSync schema, so the first stab at having a unified schema definition would be to start from a Drizzle schema.
This PR introduces
DrizzleAppSchema
andtoPowerSyncTable
, which allows you to map your Drizzle schema, or tables individually, to a PowerSync AppSchema. The mechanism for defining PowerSync table options are illustrated in the Readme and unit tests. PowerSync table indices can be derived from the Drizzle table indices, so that option is omitted from the options.Limitations
text
,integer
,real
.