jsonschema
pg_jsonschema
Our great sponsors
jsonschema | pg_jsonschema | |
---|---|---|
3 | 15 | |
446 | 924 | |
- | 3.7% | |
7.5 | 6.2 | |
3 days ago | 7 days ago | |
Rust | Rust | |
MIT License | Apache License 2.0 |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
jsonschema
-
web service framework and OpenAPI spec
Checkout this crate https://crates.io/crates/jsonschema
-
Show HN: Pg_jsonschema – A Postgres extension for JSON validation
The `jsonschema` crate author here.
First of all, this is an exciting use case, I didn't even anticipate it when started `jsonschema` (it was my excuse to play with Rust). I am extremely pleased to see such a Postgres extension :)
At the moment it supports Drafts 4, 6, and 7 + partially supports Draft 2019-09 and 2020-12. It would be really cool if we can collaborate on finishing support for these partially supported drafts! What do you think?
If you'll have any bug reports on the validation part, feel free to report them to our issue tracker - https://github.com/Stranger6667/jsonschema-rs/issues.
Re: performance - there are a couple of tricks I've been working on, so if anybody is interested in speeding this up, feel free to join here - https://github.com/Stranger6667/jsonschema-rs/pull/373
P.S. As for the "Prior Art" section, I think that https://github.com/jefbarn/pgx_json_schema should be mentioned there, as it is also based on `pgx` and `jsonschema`.
pg_jsonschema
-
Introducing pgzx: create PostgreSQL extensions using Zig
And lots of interesting extensions use it, like
https://github.com/tembo-io/pgmq
-
Beyond SQL: A relational database for modern applications
> In other words, there is still a (lossy) translation layer, it just happens to be in the RDBMS rather than in-app.
It's not lossy if your application can guarantee a json <-> datatype roundtrip and the json is validated with jsonschema (generated by your application)
In Rust it's something like this
https://serde.rs/ to do the data type <-> json mapping
https://docs.rs/schemars/latest/schemars/ to generate jsonschema from your types
https://github.com/supabase/pg_jsonschema to validate jsonschema in your database (postgres). with this setup it's interesting (but not required) to also use https://docs.rs/jsonschema/latest/jsonschema/ to validate the schema in your application
-
FerretDB, a truly open-source MongoDB alternative
Pretty exciting!
What about optionally validating some columns with jsonschema? Perhaps using https://github.com/supabase/pg_jsonschema - is using other postgres extensions supported in FerretDB? (if not, maybe it's feasible to incorporate the code of pg_jsonschema in FerretDB?)
- Type Constraints in 65 lines of SQL
-
Ask HN: Do you use JSON Schema? Help us shape its future stability guarantees
I'm not currently using it, but I'm strongly considering validating json in postgres with https://github.com/supabase/pg_jsonschema - which uses the https://docs.rs/jsonschema/latest/jsonschema/ Rust crate
So I'm not sure if my feedback is valid but, I sure hope that the jsonschema crate follows the spec! Otherwise I'll never use jsonschema but instead something-not-exactly-jsonschema. In other words.. you better not break anything.
-
Features I'd Like in PostgreSQL
Sounds dumb, but I want JSON field schema validation. I added a JSON column for flexible data, and although I'm happy with its flexibility, I kinda hope I can validate the JSON data structure. Recently I just found an extension [1] and will try soon.
-
Dynamic JSON schema validation, how can I do that in Postgres?
https://github.com/supabase/pg_jsonschema is new and looks good
-
Supabase Beta July 2022
Born as an excuse to play with pgx, pg_jsonschema is a solution we're exploring to allow enforcing more structure on json and jsonb typed postgres columns. Only 10 lines of code 😎
- GitHub - supabase/pg_jsonschema: PostgreSQL extension providing JSON Schema validation
-
Show HN: Pg_jsonschema – A Postgres extension for JSON validation
author here:
pg_jsonschema is a solution we're exploring to allow enforcing more structure on json and jsonb typed postgres columns.
We initially wrote the extension as an excuse to play with pgx, the rust framework for writing postgres extensions. That let us lean on existing rust libs for validation (jsonschema), so the extension's implementation is only 10 lines of code :)
https://github.com/supabase/pg_jsonschema/blob/fb7ab09bf6050...
happy to answer any questions!
What are some alternatives?
Fast JSON schema for Python - Fast JSON schema validator for Python.
marshmallow - A lightweight library for converting complex objects to and from simple Python datatypes.
lupin is a Python JSON object mapper - Python document object mapper (load python object from JSON and vice-versa)
RDFLib plugin providing JSON-LD parsing and serialization - JSON-LD parser and serializer plugins for RDFLib
windmill - Open-source developer platform to turn scripts into workflows and UIs. Fastest workflow engine (5x vs Airflow). Open-source alternative to Airplane and Retool.
serpy - ridiculously fast object serialization
PyValico - Small python wrapper around https://github.com/rustless/valico
cargonauts - A Rust web framework
hjson-py - Hjson for Python
jsons - 🐍 A Python lib for (de)serializing Python objects to/from JSON
Trafaret - Ultimate transformation library that supports validation, contexts and aiohttp.
PyLD - JSON-LD processor written in Python