Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
jefbarn authored Dec 16, 2022
1 parent 86946a2 commit 4f7668b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,16 @@ error_value | description | details | in
"foobar" | "foobar" is longer than 5 characters | MaxLength { limit: 5 } | | /maxLength
```

> **Warning**
> A warning about performance.
>
> Because the jsonschema crate must complile the schema before use, and Postgres uses
> separate heap per thread, this extension must compile the schema every time the function is invoked. This leads to
> pretty terrible performance for validating any large amount of data.
>
> To fix this we'd need to get the jsonschema crate to implement Copy/Clone on the JSONSchema struct and then move the
> compiled schema into shared memory where it could be reused. Will explore this in the future.
#### JSON Type Definition

> **_NOTE:_** The jtd library only reports the position of the validation errors, not a description.
Expand Down

0 comments on commit 4f7668b

Please sign in to comment.