You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the bigint type with PlanetScale or other HTTP drivers there needs to be a translation to convert a bigint into a JSON serializable value. With drizzle-orm, this is accomplished with the cast optional config parameter:
However when using drizzle-kit, this option doesn't appear to exist. This results in errors when trying to create a table migration with a bigint column that has a default value set on it (JavaScript doesn't know how to serialize the value into JSON).
You can kind of work around this via .$defaultFn(() => 0n), but you lose out on your database schema enforcing a non-null value. Ideally a cast option would be added to the drizzle-kit configuration options that would allow me to pass in the same inflate function!
The text was updated successfully, but these errors were encountered:
I wanted to file an issue for the discussion we had on Twitter about this problem!
When using the bigint type with PlanetScale or other HTTP drivers there needs to be a translation to convert a bigint into a JSON serializable value. With
drizzle-orm
, this is accomplished with thecast
optional config parameter:However when using
drizzle-kit
, this option doesn't appear to exist. This results in errors when trying to create a table migration with a bigint column that has a default value set on it (JavaScript doesn't know how to serialize the value into JSON).You can kind of work around this via
.$defaultFn(() => 0n)
, but you lose out on your database schema enforcing a non-null value. Ideally a cast option would be added to the drizzle-kit configuration options that would allow me to pass in the sameinflate
function!The text was updated successfully, but these errors were encountered: