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? |
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! |
Nope!
Most certainly a known issue. The
sqlc.arg(set_name)::boolsyntax 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!