An open API service providing package, version and dependency metadata of many open source software ecosystems and registries.

Top 8.2% on proxy.golang.org

proxy.golang.org : github.com/mitranim/jel

Overview "JSON Expession Language". Expresses a whitelisted subset of SQL with simple JSON structures. Transcodes JSON queries to SQL. Example query. See below for more code examples. Expressions are Lisp-style, using nested lists to express "calls". This syntax is used for all SQL operations. Binary infix operators are considered variadic. Lists are used for calls and casts. The first element must be a string. It may be one of the whitelisted operators or functions, listed in `SqlOps`. If not, it must be a field name or a dot-separated field path. Calls are arbitrarily nestable. Transcoding from JSON to SQL is done by consulting two things: the built-in whitelist of SQL operations (`SqlOps`, shared), and a struct type provided to that particular decoder. The struct serves as a whitelist of available identifiers, and allows to determine value types via casting. Casting allows to decode arbitrary JSON directly into the corresponding Go type: Such decoded values are substituted with ordinal parameters such as $1, and appended to the slice of arguments (see below). A string not in a call position and not inside a cast is interpreted as an identifier: field name or nested field path, dot-separated. It must be found on the reference struct, otherwise transcoding fails with an error. Literal numbers, booleans, and nulls that occur outside of casts are decoded into their Go equivalents. Like casts, they're substituted with ordinal parameters and appended to the slice of arguments. See `Expr`. JSON queries are transcoded against a struct, by matching fields tagged with `json` against fields tagged with `db`. Literal values are JSON-decoded into the types of the corresponding struct fields. The result is roughly equivalent to the following (formatted for clarity):

Registry - Source - Documentation - JSON
purl: pkg:golang/github.com/mitranim/jel
License: Unlicense
Latest release: over 3 years ago
First release: over 4 years ago
Namespace: github.com/mitranim
Stars: 0 on GitHub
Forks: 0 on GitHub
See more repository details: repos.ecosyste.ms
Last synced: 15 days ago

    Loading...
    Readme
    Loading...