If @planetscale/database returns BIGINT or unsigned 64-bit columns as strings, that is deliberate: the driver will not guess whether a value fits in a JS number, since crossing the threshold mid-stream would silently change your types. Supply a custom cast function (see the README's custom type casting section) to convert them how you like, for example Number() with a MAX_SAFE_INTEGER check, or BigInt.

_Source: gh:planetscale/database-js#175 (PlanetScale)_