I could always do validation before inserting data, but that opens me up to error on my side which I'd like to avoid=)
(Though if it exists please tell me, I'd be very interested!)
One very good, which I extensively used in my previous position was DevExpress (https://www.devexpress.com/Products/NET/Controls/WPF/Editors...).
Guess again. You can use JSON functions¹ in constraints:
create table foo (
bar jsonb,
constraint bar_count_is_positive check (bar->>'count' is not null and (bar->>'count')::integer >= 0)
);
etcYou could probably write a tool pretty easily to convert a JSON schema to Postgres constraints.
1. https://www.postgresql.org/docs/current/static/functions-jso...
http://docs.couchdb.org/en/1.6.1/couchapp/ddocs.html#validat...
In my particular case clients of different quality are connecting to a local datastore. I'd like to make sure that even if they mess up validation the data in the store still matches the schemas it claims to. Of course, I could have them connect to a local process instead and have that process handle validation before the data goes in the store, but it's always nice to avoid intermediaries.