Skip to content

Commit 5a3d2cd

Browse files
chris-b1TheCedarPrince
authored andcommitted
add test for DBInterface.prepare
1 parent ffd2eb4 commit 5a3d2cd

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

test/runtests.jl

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1910,11 +1910,24 @@ end
19101910
@test LibPQ.num_rows(result) == 1
19111911
@test LibPQ.column_name(result, 1) == "typname"
19121912
@test LibPQ.column_number(result, "typname") == 1
1913-
19141913
data = columntable(result)
1915-
19161914
@test data[:typname][1] == "bool"
19171915

1916+
qstr = "SELECT \$1::double precision as foo, typname FROM pg_type WHERE oid = \$2"
1917+
stmt = DBInterface.prepare(conn, qstr)
1918+
result = DBInterface.execute(
1919+
conn,
1920+
qstr,
1921+
(1.0, 16);
1922+
)
1923+
@test result isa LibPQ.Result
1924+
@test status(result) == LibPQ.libpq_c.PGRES_TUPLES_OK
1925+
@test isopen(result)
1926+
@test LibPQ.num_columns(result) == 2
1927+
@test LibPQ.num_rows(result) == 1
1928+
@test LibPQ.column_name(result, 1) == "foo"
1929+
@test LibPQ.column_name(result, 2) == "typname"
1930+
19181931
DBInterface.close!(result)
19191932
@test !isopen(result)
19201933

0 commit comments

Comments
 (0)