aboutsummaryrefslogtreecommitdiff
path: root/dbstore/sql/test/queryrow
diff options
context:
space:
mode:
authorPaul Duncan <pabs@pablotron.org>2022-02-26 13:55:46 -0500
committerPaul Duncan <pabs@pablotron.org>2022-02-26 13:55:46 -0500
commite2c77fc78be780d46c35584d5f33a771b14631fe (patch)
treed4298d0d007b9ae2959c106033a778e75babab65 /dbstore/sql/test/queryrow
parentd5bd2d96cf58e997565aafab251a91714bc07a21 (diff)
downloadcvez-e2c77fc78be780d46c35584d5f33a771b14631fe.tar.bz2
cvez-e2c77fc78be780d46c35584d5f33a771b14631fe.zip
dbstore: add dbstore/sql/test/query{,row}
Diffstat (limited to 'dbstore/sql/test/queryrow')
-rw-r--r--dbstore/sql/test/queryrow/ids-arg-named.sql8
-rw-r--r--dbstore/sql/test/queryrow/ids-arg-pos.sql8
-rw-r--r--dbstore/sql/test/queryrow/ids.sql7
3 files changed, 23 insertions, 0 deletions
diff --git a/dbstore/sql/test/queryrow/ids-arg-named.sql b/dbstore/sql/test/queryrow/ids-arg-named.sql
new file mode 100644
index 0000000..984669d
--- /dev/null
+++ b/dbstore/sql/test/queryrow/ids-arg-named.sql
@@ -0,0 +1,8 @@
+WITH ids(id, sort) AS (
+ VALUES ('foo', 1), ('bar', 2), ('baz', 3)
+)
+
+SELECT id
+ FROM ids
+ WHERE id = :q
+ ORDER BY sort;
diff --git a/dbstore/sql/test/queryrow/ids-arg-pos.sql b/dbstore/sql/test/queryrow/ids-arg-pos.sql
new file mode 100644
index 0000000..a13888e
--- /dev/null
+++ b/dbstore/sql/test/queryrow/ids-arg-pos.sql
@@ -0,0 +1,8 @@
+WITH ids(id, sort) AS (
+ VALUES ('foo', 1), ('bar', 2), ('baz', 3)
+)
+
+SELECT id
+ FROM ids
+ WHERE id = ?
+ ORDER BY sort;
diff --git a/dbstore/sql/test/queryrow/ids.sql b/dbstore/sql/test/queryrow/ids.sql
new file mode 100644
index 0000000..ddc2bf2
--- /dev/null
+++ b/dbstore/sql/test/queryrow/ids.sql
@@ -0,0 +1,7 @@
+WITH ids(id, sort) AS (
+ VALUES ('foo', 1), ('bar', 2), ('baz', 3)
+)
+
+SELECT id
+ FROM ids
+ ORDER BY sort;