Skip to content

Commit b4f74ee

Browse files
committed
test: LIKE ESCAPE end-to-end tests with multiple paramters
Added end-to-end tests with different combinations of parameters inside the ESCAPE clause. like_escape uses the default analyzer while like_escape_core uses the core analyzer. Both tests contain the same test cases but use the different analyzers.
1 parent 2f9b49c commit b4f74ee

13 files changed

Lines changed: 536 additions & 0 deletions

File tree

‎internal/endtoend/testdata/like_escape/sqlite/go/db.go‎

Lines changed: 31 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎internal/endtoend/testdata/like_escape/sqlite/go/models.go‎

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎internal/endtoend/testdata/like_escape/sqlite/go/query.sql.go‎

Lines changed: 193 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
-- name: SearchName :many
2+
SELECT id FROM t WHERE name LIKE ? ESCAPE ?;
3+
4+
-- name: SearchNameNamed :many
5+
SELECT id FROM t WHERE name LIKE @pattern ESCAPE @esc;
6+
7+
-- name: SearchNotLike :many
8+
SELECT id FROM t WHERE name NOT LIKE ? ESCAPE ?;
9+
10+
-- name: SearchEscapeOnly :many
11+
SELECT id FROM t WHERE name LIKE 'a!%%' ESCAPE ?;
12+
13+
-- name: SearchLiteralEscape :many
14+
SELECT id FROM t WHERE name LIKE ? ESCAPE '!';
15+
16+
-- name: SearchThenWhere :many
17+
SELECT id FROM t WHERE name LIKE ? ESCAPE ? AND score > ?;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CREATE TABLE t (id INTEGER PRIMARY KEY, name TEXT NOT NULL, score INTEGER NOT NULL);
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"version": "1",
3+
"packages": [
4+
{
5+
"path": "go",
6+
"engine": "sqlite",
7+
"name": "querytest",
8+
"schema": "schema.sql",
9+
"queries": "query.sql"
10+
}
11+
]
12+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"command": "generate",
3+
"env": {
4+
"SQLCEXPERIMENT": "coreanalyzer"
5+
}
6+
}

‎internal/endtoend/testdata/like_escape_core/sqlite/go/db.go‎

Lines changed: 31 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎internal/endtoend/testdata/like_escape_core/sqlite/go/models.go‎

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)