Skip to content

Commit

Permalink
docs: fix a few string quoting bits (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
jimlambrt committed Sep 25, 2023
1 parent 52a3917 commit 412e7ed
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ See [GRAMMAR.md](./GRAMMAR.md) for a more complete documentation of [mql](https:

Example query:

`name="alice" and age > 11 and (region % Boston or region="south shore")`
`name="alice" and age > 11 and (region % 'Boston' or region="south shore")`

### Date/Time fields

Expand Down
12 changes: 7 additions & 5 deletions docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
//
// Gorm: https://github.com/go-gorm/gorm
//
// w, err := mql.Parse("name=alice or name=bob)",User{})
// w, err := mql.Parse(`name="alice" or name="bob"`,User{})
// if err != nil {
// return nil, err
// }
// err = db.Where(w.Condition, w.Args...).Find(&users).Error
//
// database/sql: https://pkg.go.dev/database/sql
//
// w, err := mql.Parse("name=alice or name=bob)",User{})
// w, err := mql.Parse(`name="alice" or name="bob"`,User{})
// if err != nil {
// return nil, err
// }
Expand All @@ -26,7 +26,7 @@
//
// go-dbw: https://github.com/hashicorp/go-dbw
//
// w, err := mql.Parse("name=alice or name=bob)",User{})
// w, err := mql.Parse(`name="alice" or name="bob")`,User{})
// if err != nil {
// return nil, err
// }
Expand All @@ -41,7 +41,9 @@
// Fields in your model can be compared with the following operators:
// =, !=, >=, <=, <, >, %
//
// Double quotes `"` can be used to quote strings.
// 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.
//
Expand All @@ -58,5 +60,5 @@
//
// Example query:
//
// name=alice and age > 11 and (region % Boston or region="south shore")
// name="alice" and age > 11 and (region % "Boston" or region="south shore")
package mql

0 comments on commit 412e7ed

Please sign in to comment.