Skip to content

fix: Add warning for mysql2 client configuration for bigint #537

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/content/docs/column-types/mysql.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,20 @@ CREATE TABLE `table` (

We've omitted config of `M` in `bigint(M)`, since it indicates the display width of the numeric type

<Callout type="warning">
Using an external mysql2 client, ensure that `supportBigNumbers` and `bigNumberStrings` are enabled.
Without enabling these options may result in data loss or unexpected errors due to inaccurate handling of large numbers.

```ts copy
const connection = mysql.createPool({
...
supportBigNumbers: true,
bigNumberStrings: true,
});
export const db = drizzle(connection);
```
</Callout>

## ---

### real
Expand Down