Bug report
Describe the bug
When generating TypeScript types, the current code “correctly” converts numeric types to number, as Postgres and Postgrest return such columns as JSON numbers by default without a query cast to ::text.
However, generated insert and update types are limited to number, whereas the underlying APIs will accept a string and preserve precision this way. As such, the generated update and insert types for these fields should allow for string parameters.
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
- Define a table with column type
NUMERIC or DECIMAL.
- Generate TypeScript types for the table.
- Observe that the
Row type is number, but so are the Insert and Update types.
Expected behavior
number | string is used instead for Insert and Update types.
Additional context
Currently we're having to cast strings as unknown as number or @ts-expect-error for all insert/update calls to get around this.