Skip to content

v0.154.0

Choose a tag to compare

@nstfkc nstfkc released this 19 Oct 19:55
· 178 commits to main since this release

New

  • Typed Json columns (#995, #999): declare static $json = { column: schema } on a model. The column is parsed on read and validated on write, and rows are typed through the generator. Re-run prisma generate to get the types.

Upgrade notes

  • Opt-in per model: nothing changes until a model declares $json.
  • A stored value that doesn't match the schema throws JsonColumnError on read by default. For columns that already have rows, use invalid: "null" or a fallback.
  • Rows returned by writes never throw; they come back as stored.
  • DbNull is refused on non-nullable typed columns, and so is JsonNull unless the schema accepts null.
    See docs/orm.md.