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

[BUG]: drizzle-kit instrospect command generates syntax error on varchar column types #2714

Closed
JohnFScha opened this issue Jul 31, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@JohnFScha
Copy link

What version of drizzle-orm are you using?

0.32.0

What version of drizzle-kit are you using?

0.23.0

Describe the Bug

When exporting the db schemas and relations from a Postgres DB with the drizzle-kit introspect command, the schema.ts output file recognices two syntax errors: 1) when defining the length of a varchar column type, the file has an extra bracket ( '[' ) and an extra parenthesis ( '(' ) back to back, eleminating these characters solves the syntax error. 2) when defining a default value for a varchar type column, the ::character_varying notation is marked as a syntax error, erasing this part of the default value expression solves the syntax error (the end result would be: someColumnDefinition.default("")).

Expected behavior

I think the expected behaviour would be the one already working, but without the syntax errors. I don't know if the ::character_varying should be imported from drizzle-kit, but the intellisense does not provide any type of autocomplete or import suggestion for that part of the expression.

Environment & setup

turborepo 2.0.5, working in development mode for the time being.

@JohnFScha JohnFScha added the bug Something isn't working label Jul 31, 2024
@AndriiSherman
Copy link
Member

This should be fixed in drizzle-kit@0.24.1
If you still encounter this issue, please reopen the ticket

@JohnFScha
Copy link
Author

Updating now to give it a try!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants