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

fix: Support new Postgres index API #13

Merged
merged 5 commits into from
Jun 5, 2024
Merged

Conversation

rorz
Copy link
Contributor

@rorz rorz commented Jun 4, 2024

Drizzle 0.31.0 introduced a breaking change to the Postgres indexes API. The lack of support in drizzle-dbml-generator for enriched "extra config" columns led to two failure scenarios with the current build:

  1. Unrecognised ordering options in extra config e.g. tbl.f1.asc() (asc() not found in standard column type)
  2. Inability for the underlying drizzle-orm calls to use the indexes. JSON parsing would fail since the defaultConfig on a given column wasn't being set or enriched.

What has changed

  • Update drizzle-orm dev-dependency to the latest version (0.31.1)
  • Extract richer / correct extra config for columns via a new ExtraConfigColumns symbol. This is specific to Postgres but functionally works in a dialect-agnostic way.
  • Re-word extraConfigextraConfigBuilder to make language clearer and more accurate
  • Add some more tests for the new API

resolves #12

Copy link
Owner

@L-Mario564 L-Mario564 left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! I'll merge and create a new release later today

@L-Mario564 L-Mario564 merged commit 57cc2d4 into L-Mario564:main Jun 5, 2024
1 check passed
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.

Error generating DBML: SyntaxError: "undefined" is not valid JSON
2 participants