Skip to content

Commit 236f721

Browse files
committed
updates
1 parent 547d731 commit 236f721

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

tests/db_utils_case_quoted.sql

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77
id integer primary key
88
);
99

10+
-- std sql quoted table name
1011
create table "Quoted Table" (
1112
id integer primary key
1213
);
14+
15+
-- sqlite quoted table name
16+
create table `Quoted Table2` (
17+
id integer primary key
18+
);

tests/tdb_utils.nim

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,27 @@ let sqlContent = """
1818
id integer primary key
1919
);
2020
21+
-- std sql quoted table name
2122
create table "Quoted Table" (
2223
id integer primary key
2324
);
25+
26+
-- sqlite quoted table name
27+
create table `Quoted Table2` (
28+
id integer primary key
29+
);
2430
"""
2531

2632
writeFile(sqlFile, sqlContent)
2733

2834
suite "db_utils: case and quoted names":
2935
test "check tables names":
3036
let pairs = tablePairs(sqlFile).toSeq()
31-
check pairs.len == 3
37+
check pairs.len == 4
3238
check pairs[0][0] == ("lower_table")
3339
check pairs[1][0] == ("upper_table")
3440
check pairs[2][0] == ("quoted table")
41+
check pairs[3][0] == ("quoted table2")
3542

3643

3744
check pairs[0][1] == "create table lower_table(id integer primary key );"

0 commit comments

Comments
 (0)