Add set ∋ / ∌ to SQL where clauses
This commit is contained in:
parent
23be4b9387
commit
6b6755695b
3 changed files with 6 additions and 2 deletions
|
@ -90,7 +90,7 @@ func (p *Parser) parseWhere() (Expr, error) {
|
|||
}
|
||||
w.LHS = declare(tok, lit)
|
||||
|
||||
tok, lit, err = p.shouldBe(IN, EQ, NEQ, GT, LT, GTE, LTE, EQR, NER)
|
||||
tok, lit, err = p.shouldBe(IN, EQ, NEQ, GT, LT, GTE, LTE, EQR, NER, SEQ, SNE)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
|
@ -306,7 +306,7 @@ func Test_Parse_Queries_Select(t *testing.T) {
|
|||
},
|
||||
{
|
||||
sql: "SELECT * FROM person WHERE id",
|
||||
err: "found `` but expected `IN, =, !=, >, <, >=, <=, =~, !~`",
|
||||
err: "found `` but expected `IN, =, !=, >, <, >=, <=, =~, !~, ∋, ∌`",
|
||||
},
|
||||
{
|
||||
sql: "SELECT * FROM person WHERE id =",
|
||||
|
|
|
@ -73,6 +73,8 @@ const (
|
|||
GTE // >=
|
||||
EQR // =~
|
||||
NER // !~
|
||||
SEQ // ∋
|
||||
SNE // ∌
|
||||
|
||||
operatorEnd
|
||||
|
||||
|
@ -176,6 +178,8 @@ var tokens = [...]string{
|
|||
GTE: ">=",
|
||||
EQR: "=~",
|
||||
NER: "!~",
|
||||
SEQ: "∋",
|
||||
SNE: "∌",
|
||||
|
||||
// keywords
|
||||
|
||||
|
|
Loading…
Reference in a new issue