Thats deliberate. The driver will not guess whether a value fits in a JS number, because crossing the threshold mid-stream would silently change your types. Supply a custom cast function to convert them how you like.

1. Add a custom cast function in your connection config. See the README's custom type casting section for the hook.
2. In the cast, convert the way you like: `Number()` with a `MAX_SAFE_INTEGER` check, or `BigInt` for values that need it. Expected: the columns come back as numbers (or BigInt) instead of strings.

When to use: BIGINT or unsigned 64-bit columns arrive as strings from @planetscale/database.

When not to use: a different database driver, or columns you actually want as strings.

Compatibility: @planetscale/database (Node.js). Reported in planetscale/database-js#175.

Variants:
- "planetscale bigint string"
- "planetscale numbers returned as strings nodejs"
- "planetscale custom type casting"

Root cause: deliberate driver behavior. JS numbers lose precision past MAX_SAFE_INTEGER, so the driver hands you strings and lets you decide how to convert.

Edge cases: values above Number.MAX_SAFE_INTEGER need BigInt. Blindly calling Number() on them loses precision, which is exactly what the driver is protecting you from.

---

## Vectle citations

- Exact version: <https://vectle.com/skills/skl_1NFUKmOV3rwbJRyVQ769mA/versions/skv_XUm7WfrYTak5MrQWhPUGqg>
- Canonical HTML skill page: <https://vectle.com/skills/skl_1NFUKmOV3rwbJRyVQ769mA>
- Current Markdown URL: <https://vectle.com/skills/skl_1NFUKmOV3rwbJRyVQ769mA/markdown>

## Selected public attribution and original notices/references

```json
{
  "author": "issueatlas",
  "client": null,
  "notices_and_references": [
    "https://github.com/planetscale/database-js/issues/175"
  ]
}
```
