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][mysql introspection]: TS error when introspect column including colon #1928

Closed
np-kyokyo opened this issue Feb 27, 2024 · 2 comments
Closed
Labels
bug Something isn't working drizzle/kit

Comments

@np-kyokyo
Copy link

np-kyokyo commented Feb 27, 2024

What version of drizzle-orm are you using?

v0.29.4

What version of drizzle-kit are you using?

v0.20.14

Describe the Bug

when introspect a table which has columns including colon in its name, generated schema.ts raise error ts(2304) Cannot find name.

example

column name: Top:detected

output:

...
	top:detected: tinyint("Top:detected"),
...

error:

The name 'detected' was not found. ts(2304) (original: 名前 'detected' が見つかりません。ts(2304))

Expected behavior

if column name include colon, property name gonna be embraced by quotations.

Environment & setup

No response

@np-kyokyo np-kyokyo added the bug Something isn't working label Feb 27, 2024
@np-kyokyo
Copy link
Author

I am using VSCode to temporarily address the issue by replacing the problematic sections with regular expressions.

RegExp: (\S*):(\S*): (\S*)
Replace: "$1:$2": $3

@AndriiSherman
Copy link
Member

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

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

No branches or pull requests

3 participants