1
- using SqlStrings
1
+ using SQLStrings
2
2
using Test
3
3
using UUIDs
4
4
5
- querystr (q) = SqlStrings . prepare (q)[1 ]
6
- queryargs (q) = SqlStrings . prepare (q)[2 ]
5
+ querystr (q) = SQLStrings . prepare (q)[1 ]
6
+ queryargs (q) = SQLStrings . prepare (q)[2 ]
7
7
8
- @testset " SqlStrings .jl" begin
8
+ @testset " SQLStrings .jl" begin
9
9
x = 1
10
10
y = 2
11
11
q1 = sql ` select a where b=$x and c=$(x+ y) `
@@ -28,7 +28,7 @@ queryargs(q) = SqlStrings.prepare(q)[2]
28
28
# On occasion, we need to interpolate in a literal string rather than use a
29
29
# parameter. Test that interpolating Literal works for this case.
30
30
column = " x"
31
- @test querystr (sql ` select $(SqlStrings . Literal (column)) from a` ) ==
31
+ @test querystr (sql ` select $(SQLStrings . Literal (column)) from a` ) ==
32
32
raw " select x from a"
33
33
34
34
# Test splatting syntax
@@ -38,8 +38,8 @@ queryargs(q) = SqlStrings.prepare(q)[2]
38
38
@test queryargs (q4) == z
39
39
40
40
# Test that Literal turns values into strings
41
- @test SqlStrings . Literal (:col_name ). fragment == " col_name"
42
- @test SqlStrings . Literal (1 ). fragment == " 1"
41
+ @test SQLStrings . Literal (:col_name ). fragment == " col_name"
42
+ @test SQLStrings . Literal (1 ). fragment == " 1"
43
43
44
44
# Test dollars inside SQL strings - the $x here should be a literal.
45
45
q5 = sql ` select $y where x = '$x '`
@@ -49,8 +49,8 @@ queryargs(q) = SqlStrings.prepare(q)[2]
49
49
q6 = sql ` some literal \$ a`
50
50
@test querystr (q6) == raw " some literal $a"
51
51
52
- SqlStrings . allow_dollars_in_strings[] = false
52
+ SQLStrings . allow_dollars_in_strings[] = false
53
53
@test_throws LoadError @macroexpand sql ` select $y where x = '$x '`
54
- SqlStrings . allow_dollars_in_strings[] = true
54
+ SQLStrings . allow_dollars_in_strings[] = true
55
55
end
56
56
0 commit comments