Skip to content

Commit 39f8a65

Browse files
committed
update example
1 parent 72d6b03 commit 39f8a65

File tree

4 files changed

+16
-12
lines changed

4 files changed

+16
-12
lines changed

examples/bun-mysql2/src/db/query_sql.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ SELECT id, name, bio FROM authors
77
WHERE id = ? LIMIT 1`;
88

99
export interface GetAuthorArgs {
10-
id: number;
10+
id: string;
1111
}
1212

1313
export interface GetAuthorRow {
14-
id: number;
14+
id: string;
1515
name: string;
1616
bio: string | null;
1717
}
@@ -38,7 +38,7 @@ SELECT id, name, bio FROM authors
3838
ORDER BY name`;
3939

4040
export interface ListAuthorsRow {
41-
id: number;
41+
id: string;
4242
name: string;
4343
bio: string | null;
4444
}
@@ -82,7 +82,7 @@ DELETE FROM authors
8282
WHERE id = ?`;
8383

8484
export interface DeleteAuthorArgs {
85-
id: number;
85+
id: string;
8686
}
8787

8888
export async function deleteAuthor(client: Client, args: DeleteAuthorArgs): Promise<void> {
@@ -105,8 +105,8 @@ export interface TestRow {
105105
cMediumint: number | null;
106106
cInt: number | null;
107107
cInteger: number | null;
108-
cBigint: number | null;
109-
cSerial: number;
108+
cBigint: string | null;
109+
cSerial: string;
110110
cDecimal: string | null;
111111
cDec: string | null;
112112
cNumeric: string | null;

examples/bun-mysql2/src/main.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ async function main() {
1616
user: url.username,
1717
password: url.password,
1818
database: url.pathname.substring(1),
19+
supportBigNumbers: true,
20+
bigNumberStrings: true,
1921
ssl: {
2022
// TODO: FIXME
2123
rejectUnauthorized: false,

examples/node-mysql2/src/db/query_sql.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ SELECT id, name, bio FROM authors
77
WHERE id = ? LIMIT 1`;
88

99
export interface GetAuthorArgs {
10-
id: number;
10+
id: string;
1111
}
1212

1313
export interface GetAuthorRow {
14-
id: number;
14+
id: string;
1515
name: string;
1616
bio: string | null;
1717
}
@@ -38,7 +38,7 @@ SELECT id, name, bio FROM authors
3838
ORDER BY name`;
3939

4040
export interface ListAuthorsRow {
41-
id: number;
41+
id: string;
4242
name: string;
4343
bio: string | null;
4444
}
@@ -82,7 +82,7 @@ DELETE FROM authors
8282
WHERE id = ?`;
8383

8484
export interface DeleteAuthorArgs {
85-
id: number;
85+
id: string;
8686
}
8787

8888
export async function deleteAuthor(client: Client, args: DeleteAuthorArgs): Promise<void> {
@@ -105,8 +105,8 @@ export interface TestRow {
105105
cMediumint: number | null;
106106
cInt: number | null;
107107
cInteger: number | null;
108-
cBigint: number | null;
109-
cSerial: number;
108+
cBigint: string | null;
109+
cSerial: string;
110110
cDecimal: string | null;
111111
cDec: string | null;
112112
cNumeric: string | null;

examples/node-mysql2/src/main.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ async function main() {
2222
user: url.username,
2323
password: url.password,
2424
database: url.pathname.substring(1),
25+
supportBigNumbers: true,
26+
bigNumberStrings: true,
2527
ssl: {
2628
// TODO: FIXME
2729
rejectUnauthorized: false,

0 commit comments

Comments
 (0)