Open yshrsmz opened 8 months ago
@kyleconroy How can I find out PK's type?
I checked every value in GenerateRequest
, but could not find one.
AFAIK, we can return Promise<string | number>
from :execlastid
, but it's not possible to define explicit type with current information.
related: #13, #15
https://github.com/sqlc-dev/sqlc-gen-typescript/blob/1a42ab0ef40a8ed47e379fa7677fcedc5fe92150/examples/node-mysql2/src/db/query_sql.ts#L94-L100
This method should return
string
assupport_big_numbers
andbig_number_strings
is enabled in sqlc.dev.ymlhttps://github.com/sqlc-dev/sqlc-gen-typescript/blob/1a42ab0ef40a8ed47e379fa7677fcedc5fe92150/examples/sqlc.dev.yaml#L43-L54
This is because I explicitly declared a return type as
number
herehttps://github.com/sqlc-dev/sqlc-gen-typescript/pull/13/files#diff-2078b150759ca61c4ae2bb37cb070f5a2d81e64c7b4d1aa126f621e2520f13d0R641-R643
but should respect PK's type.