Type-hinting for MySQL? #686
-
Is there a way to get the "type hinting" in https://github.com/kyleconroy/sqlc/blob/master/docs/named_parameters.md (e.g., I'm trying to get types for a query like: SELECT * FROM things
WHERE x = sqlc.arg(x)
AND y = sqlc.arg(y)
AND ABS(DATEDIFF(created_at, sqlc.arg(created_at))) < 15; but Trying to do a MySQL-style Is this supposed to work right now, or is it a known issue that more work needs to be done to support this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Nope!
Most certainly a known issue. The I'd also like to point out #655, which would also fix your issue. Since the DATEDIFF function takes two arguments of known types, sqlc will pick the correct type automatically. The issue is that I haven't generated the functions definitions yet. Soon! |
Beta Was this translation helpful? Give feedback.
Nope!
Most certainly a known issue. The
sqlc.arg(set_name)::bool
syntax is PostgreSQL syntactic sugar forCAST ... AS
. I've opened #687 to track implementation.I'd also like to point out #655, which would also fix your issue. Since the DATEDIFF function takes two arguments of known types, sqlc will pick the correct type automatically. The issue is that I haven't generated the functions definitions yet. Soon!