Skip to content

Commit b0621fd

Browse files
sgress454taozhi8833998
authored andcommitted
add test
1 parent 85f0678 commit b0621fd

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

test/sqlite.spec.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ describe('sqlite', () => {
163163
sql = ' CREATE TABLE `Test` ( `id` int(11) NOT NULL, `name` varchar(255) COLLATE utf8mb4_unicode_520_ci NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `name` (`name`));'
164164
ast = parser.astify(sql, { database: 'mariadb' })
165165
expect(parser.sqlify(ast, DEFAULT_OPT)).to.be.equal('CREATE TABLE "Test" ("id" INT(11) NOT NULL, "name" VARCHAR(255) NOT NULL, PRIMARY KEY ("id"), UNIQUE ("name"))')
166-
sql = `SELECT
166+
sql = `SELECT
167167
b.brand_name,
168168
p.prompt_text,
169169
m.model_name,
@@ -265,4 +265,8 @@ describe('sqlite', () => {
265265
expect(getParsedSql(sql)).to.be.equal(`INSERT OR ${keyword} INTO "test" (category) VALUES ('Infra, Layer1, DePIN')`)
266266
})
267267
})
268+
it('should support LIKE with ESCAPE', () => {
269+
const sql = `SELECT * FROM table_name WHERE column_name LIKE '%pattern%' ESCAPE '\'`
270+
expect(getParsedSql(sql)).to.be.equal(`SELECT * FROM "table_name" WHERE "column_name" LIKE '%pattern%' ESCAPE '\'`)
271+
})
268272
})

0 commit comments

Comments
 (0)