sqlc-dev / sqlc-gen-typescript

364 stars 17 forks source link

Add support for sqlc.slice() #47

Open daison12006013 opened 1 week ago

daison12006013 commented 1 week ago

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

Expectation:

Outcome:


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