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

[pg-kit] Fix invalid javascript syntax for default() values in generated schema. #4328

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

minhoryang
Copy link

@minhoryang minhoryang commented Mar 28, 2025

Fixes #4121

Fix invalid javascript syntax for default() values in generated schema.

  • Modify unescapeSingleQuotes() function in drizzle-kit/src/utils.ts to correctly process two adjacent single quotes.
  • Add new test cases for varcharEmpty and varcharSingleQuotes in drizzle-kit/tests/introspect/pg.test.ts.

For more details, open the Copilot Workspace session.

@minhoryang minhoryang marked this pull request as ready for review March 28, 2025 06:25
@minhoryang minhoryang force-pushed the fix/issue-4121 branch 2 times, most recently from b0c52b0 to fdd96c2 Compare March 28, 2025 12:52
…rated schema.

Fixes drizzle-team#4121

Fix invalid javascript syntax for `default()` values in generated schema.

* Modify `unescapeSingleQuotes()` function in `drizzle-kit/src/utils.ts` to correctly process two adjacent single quotes.
* Add new test cases for `varcharEmpty` and `varcharSingleQuotes` in `drizzle-kit/tests/introspect/pg.test.ts`.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/drizzle-team/drizzle-orm/issues/4121?shareId=XXXX-XXXX-XXXX-XXXX).
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.

[BUG]: drizzle-kit generates schema with invalid JavaScript syntax in default values
1 participant