Skip to content

Commit 40837a7

Browse files
committed
feat: support double equal symbol in sqlite
1 parent cbf5ec2 commit 40837a7

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

pegjs/sqlite.pegjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2049,7 +2049,7 @@ arithmetic_op_right
20492049
}
20502050

20512051
arithmetic_comparison_operator
2052-
= ">=" / ">" / "<=" / "<>" / "<" / "=" / "!="
2052+
= ">=" / ">" / "<=" / "<>" / "<" / "==" / "=" / "!="
20532053

20542054
is_op_right
20552055
= KW_IS __ right:additive_expr {

test/sqlite.spec.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,4 +178,9 @@ describe('sqlite', () => {
178178
sql = 'ALTER TABLE customers RENAME COLUMN age TO customer_age;'
179179
expect(getParsedSql(sql)).to.be.equal('ALTER TABLE "customers" RENAME COLUMN "age" TO "customer_age"')
180180
})
181+
182+
it('should support double equal', () => {
183+
const sql = "SELECT * FROM sqlite_master WHERE name == 'test'"
184+
expect(getParsedSql(sql)).to.be.equal(`SELECT * FROM "sqlite_master" WHERE "name" == 'test'`)
185+
})
181186
})

0 commit comments

Comments
 (0)