pg_jsonschema: JSON Schema support for Postgres
Today, Supabase released pg_jsonschema, a Postgres extension that adds JSON Schema validation support for json and jsonb data types. This extension allows developers to enforce constraints on document data types in SQL databases, similar to those applied by relational databases. The extension offers two functions: json_matches_schema() and jsonb_matches_schema(), which can validate a json or jsonb instance against a JSON Schema. By using these functions in combination with check constraints, developers can ensure that their data models are well-specified while still taking advantage of the flexibility offered by document data types.
Company
Supabase
Date published
Aug. 19, 2022
Author(s)
Oliver Rice
Word count
763
Language
English
Hacker News points
219