sqlalchemy: Add missing json/jsonb operators in PostgreSQL
Since the json/jsonb support in SQLAlchemy was added PostgreSQL has added some new operators, like @@ and @? in v12 https://www.postgresql.org/docs/12/datatype-json.html
It would be nice to add the missing operators to the relevant types.
One thing to finalize are the names of these operators, that are not immediately clear from the postgresql docs
First raised in https://github.com/sqlalchemy/sqlalchemy/discussions/7146
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 15 (14 by maintainers)
Guilherme Martins Crocetti has proposed a fix for this issue in the main branch:
Implement missing
#-,@?and@@Postgres’ JSONB operators. https://gerrit.sqlalchemy.org/c/sqlalchemy/sqlalchemy/+/4336it seems not
prints
ah ha! the code has this string:
" -> "and I was searching for"->"and'->'(no leading/trailing whitespace).I’ll recheck the source and update the table above
These are jsonpath operators. They are defined in the docs in table 9.45
Table 9.45. Additional jsonb Operators
There is a note a bit down the page that hints at potential names, as they seem to be shorthand for corollary functions with some presets :