4 ms·
I'd assume this might be solvable in the DB layer using CHECK constraints, possibly combined with JSON Schema validation? From quick glance, JSON Schema valida
by evanelias 2y ago
I'd assume this might be solvable in the DB layer using CHECK constraints, possibly combined with JSON Schema validation?
From quick glance, JSON Schema validation isn't built-in to Postgres, but there are third-party extensions, such as https://github.com/supabase/pg_jsonschema https://github.com/supabase/pg_jsonschema or https://github.com/gavinwahl/postgres-json-schema https://github.com/gavinwahl/postgres-json-schema.
I'm more familiar with MySQL and MariaDB, which offer it built-in: https://dev.mysql.com/doc/refman/8.0/en/json-validation-functions.html https://dev.mysql.com/doc/refman/8.0/en/json-validation-func... and https://mariadb.com/kb/en/json_schema_valid/ https://mariadb.com/kb/en/json_schema_valid/