8 CREATE TABLE test (id INTEGER PRIMARY KEY AUTOINCREMENT,name TEXT,descr TEXT);
9 -- [sql2cpp] name=select_all
11 SELECT name,descr FROM test;
14 let tt stmt scheme params
=
15 let print_scheme = RA.Scheme.to_string
in
16 let print_params = Stmt.params_to_string
in
19 Parser.parse_stmt stmt
21 | _
-> assert_failure
"parsing failed"
23 assert_equal ~printer
:print_scheme scheme s1
;
24 assert_equal ~printer
:print_params params p1
27 tt "CREATE TABLE q (id INT, str TEXT, name TEXT)"
30 tt "SELECT str FROM q WHERE id=?"
33 tt "SELECT x,y+? AS z FROM (SELECT id AS y,CONCAT(str,name) AS x FROM q WHERE id=@id*2) ORDER BY x,x+y LIMIT @lim"
34 [attr
"x" Text
; attr
"z" Text
]
35 [Next
,None
; Named
"id", None
; Named
"lim",Some Int
; ]
43 let test_suite = "main" >::: tests in
44 ignore
(run_test_tt
test_suite)