sqltyper
sqltyper copied to clipboard
LIMIT param type is string
in the following query:
SELECT *
FROM foo
LIMIT ${count}
count will be added as a parameter with type string, though I'd expect it to be of type number.
LIMIT expects a bigger int than what fits to a JavaScript number (perhaps u64), and thus node-postgres uses string instead of number.
I don’t think there’s an obvious fix for this in the sqltyper side. We have to adhere to the type conversions of node-postgres.
You can of course tweak the query to have LIMIT ${count}::int to get it inferred as number.