Moved to https://github.com/mitranim/sqlb. This repo is usable but frozen.
"JSON Expession Language". Expresses a whitelisted subset of SQL with simple JSON structures. Transcodes JSON queries to SQL.
See the full documentation at https://godoc.org/github.com/mitranim/jel.
See the sibling library https://github.com/mitranim/sqlb for SQL query building.
Expr.AppendTo for consistency with other libraries. The repo is now frozen/moved. See https://github.com/mitranim/sqlb.
Update to match the recent breaking changes in the
Ord after moving it to
sqlb, which is a dependency of this package.
Minor breaking change:
Ord now uses the
nulls last qualifier. We might want to make this configurable in the future.
Ords for SQL
The new type
Ords represents an SQL
order by clause in a structured fashion, and allows to safely decode it from client input. Just like
Ords is performed by consulting a user-specified struct type. JSON field names are converted to DB column names, unknown fields cause a parse error. When encoding for SQL, identifiers are quoted for safety.
Minor breaking change: renamed
First tagged release.
I'm receptive to suggestions. If this library almost satisfies you but needs changes, open an issue or chat me up. Contacts: https://mitranim.com/#contacts