You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When overriding int8 to uint it is not respected when using syntax like .... _id = ANY($1::int8[]);
Generated function creates int64 parameter instead of uint.
Relevant log output
No response
Database schema
No response
SQL queries
SELECT*FROM page
WHERE internal_id = ANY($1::int8[]);
Facing very similar issue, where a param to my query is an array of values.
SELECT*FROM events WHERE event_type = ANY($1::SMALLINT[]);
In my case, I have a Go type that extends int16 as a form to create an enum in my codebase.
typeEventTypeint16const (
...
)
I want to be able to pass EventType around instead of int16 to the queries, so that I don't need to do casting allover the place.
While this works perfectly fine for when param/column is a single value, it doesn't work correctly for an array as illustrated above, because in the query itself we're telling SQLC to use smallint (int16) instead.
While it is possible to create an override for a smallint so that it maps to EventType, that would map all uses of smallint to EventType which is not what I want.
Version
1.27.0
What happened?
When overriding int8 to uint it is not respected when using syntax like
.... _id = ANY($1::int8[])
;Generated function creates int64 parameter instead of uint.
Relevant log output
No response
Database schema
No response
SQL queries
Configuration
Playground URL
https://play.sqlc.dev/p/3c687ce27bb56bf8c536047234a748c6a17e283475e00516c8df113d0f9fd45e
What operating system are you using?
macOS
What database engines are you using?
PostgreSQL
What type of code are you generating?
Go
The text was updated successfully, but these errors were encountered: