proxy.golang.org : github.com/hashicorp/mql : v0.1.4
Package mql provides a language that end users can use to query your database models, without them having to learn SQL or exposing your application to SQL injection. Gorm: https://github.com/go-gorm/gorm database/sql: https://pkg.go.dev/database/sql go-dbw: https://github.com/hashicorp/go-dbw You define a model you wish to query as a Go struct and provide a mql query. The package then uses the query along with a model to generate a parameterized SQL where clause. Fields in your model can be compared with the following operators: =, !=, >=, <=, <, >, % Strings must be quoted. Double quotes ", single quotes ' or backticks ` can be used as delimiters. Users can choose whichever supported delimiter makes it easier to quote their string. Comparison operators can have optional leading/trailing whitespace. The % operator allows you to do partial string matching using LIKE and this matching is case insensitive. The = equality operator is case insensitive when used with string fields. Comparisons can be combined using: and, or. More complex queries can be created using parentheses. See [GRAMMAR.md]: https://github.com/hashicorp/mql/blob/main/GRAMMAR.md for a more complete documentation of mql's grammar. Example query:
Registry -
Documentation -
Download -
JSON
purl: pkg:golang/github.com/hashicorp/[email protected]
Published:
Indexed:
- github.com/davecgh/go-spew v1.1.1
- github.com/google/go-cmp v0.6.0
- github.com/pmezard/go-difflib v1.0.0
- github.com/stretchr/testify v1.8.4
- golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842
- golang.org/x/mod v0.17.0
- golang.org/x/sync v0.7.0
- golang.org/x/tools v0.21.0
- gopkg.in/yaml.v3 v3.0.1
- mvdan.cc/gofumpt v0.5.0