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

Add support for sqlc.slice() #47

Open
daison12006013 opened this issue Nov 19, 2024 · 0 comments
Open

Add support for sqlc.slice() #47

daison12006013 opened this issue Nov 19, 2024 · 0 comments

Comments

@daison12006013
Copy link

daison12006013 commented Nov 19, 2024

I've noticed that when using sqlc.slice('names'), it really behaves differently, compared to what it is generated in golang

Expectation:

  • it should make the names as array like data once it's converted to typescript

Outcome:

  • it converts to string | null type only!

in Golang, it is correctly converted and the logic that replaces the docblock SQL Slice is being written properly
image

In typescript, it is wrongly interpreted, basically mysql2 requires to be an array so that it will do its job to wrap it into a comma separated values.
image

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

No branches or pull requests

1 participant