Add set ∋ / ∌ to SQL where clauses

This commit is contained in:
Tobie Morgan Hitchcock 2016-02-26 17:45:40 +00:00
parent 23be4b9387
commit 6b6755695b
3 changed files with 6 additions and 2 deletions

View file

@ -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
}

View file

@ -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 =",

View file

@ -73,6 +73,8 @@ const (
GTE // >=
EQR // =~
NER // !~
SEQ // ∋
SNE // ∌
operatorEnd
@ -176,6 +178,8 @@ var tokens = [...]string{
GTE: ">=",
EQR: "=~",
NER: "!~",
SEQ: "∋",
SNE: "∌",
// keywords