-
Notifications
You must be signed in to change notification settings - Fork 37
Open
Description
sqlc-gen-typescript/examples/node-mysql2/src/db/query_sql.ts
Lines 94 to 100 in 1a42ab0
| export async function createAuthorReturnId(client: Client, args: CreateAuthorReturnIdArgs): Promise<number> { | |
| const [result] = await client.query<ResultSetHeader>({ | |
| sql: createAuthorReturnIdQuery, | |
| values: [args.name, args.bio] | |
| }); | |
| return result?.insertId ?? 0; | |
| } |
This method should return string as support_big_numbers and big_number_strings is enabled in sqlc.dev.yml
sqlc-gen-typescript/examples/sqlc.dev.yaml
Lines 43 to 54 in 1a42ab0
| - schema: "authors/mysql/schema.sql" | |
| queries: "authors/mysql/query.sql" | |
| engine: "mysql" | |
| codegen: | |
| - plugin: ts | |
| out: node-mysql2/src/db | |
| options: | |
| runtime: node | |
| driver: mysql2 | |
| mysql2: | |
| big_number_strings: true | |
| support_big_numbers: true |
This is because I explicitly declared a return type as number here
but should respect PK's type.
Metadata
Metadata
Assignees
Labels
No labels