Repository navigation
Commit e71d7f0
fix(mysql): Make :execlastid respect big number options
The bigint column mapping already honored support_big_numbers /
big_number_strings, but :execlastid always returned Promise<number>,
so AUTO_INCREMENT bigint keys silently lied about their type.
The insert id now follows the same rules as bigint columns:
big_number_strings returns string (converted with String(), since the
driver returns big values as strings while the mysql2 typings declare
insertId as number), support_big_numbers alone returns number | string,
and the default stays number.
Verified against the node-mysql2 example (both options enabled), which
now returns Promise<string>, and the bun-mysql2 example (no options),
which is unchanged; both outputs compile with the examples' tsconfig.
Fixes #22.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GFyrFwpJC2eivaBRyNBJqv1 parent 9198dca commit e71d7f0
2 files changed
Lines changed: 43 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
96 | | - | |
| 96 | + | |
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | | - | |
| 101 | + | |
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
48 | 62 | | |
49 | 63 | | |
50 | 64 | | |
| |||
658 | 672 | | |
659 | 673 | | |
660 | 674 | | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
661 | 690 | | |
662 | 691 | | |
663 | 692 | | |
| |||
668 | 697 | | |
669 | 698 | | |
670 | 699 | | |
671 | | - | |
| 700 | + | |
672 | 701 | | |
673 | 702 | | |
674 | 703 | | |
| |||
732 | 761 | | |
733 | 762 | | |
734 | 763 | | |
735 | | - | |
736 | | - | |
737 | | - | |
738 | | - | |
739 | | - | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
740 | 773 | | |
741 | | - | |
742 | | - | |
| 774 | + | |
743 | 775 | | |
744 | 776 | | |
745 | 777 | | |
| |||
0 commit comments