You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was trying to reduce the amount of prepared statements in order to work around this issue crystal-lang/crystal-db#60
I ran into bugs with using unprepared statements. I added the following spec and it fails.
If you change db.unprepared.query to db.query it uses a prepared statement and that works fine.
it "allows unprepared statement queries"do |db|
db.exec %(create table if not exists a (i int not null, str text not null);)
db.exec %(insert into a (i, str) values (23, "bai bai");)2.times do |i|
DB.open db.uri do |db|
begin
db.unprepared.query("SELECT i, str FROM a WHERE i = 23") do |rs|
rs.each do
rs.read(Int32).should eq 23
rs.read(String).should eq "bai bai"endendrescue e
fail("Expected no exception, but got \"#{e.message}\"")
endendendend
Failures:
1) as a db allows unprepared statement queries
Failure/Error: fail("Expected no exception, but got \"#{e.message}\"")
Expected no exception, but got "Expected: "bai bai" got: "\u0007b""# spec/db_spec.cr:194
The text was updated successfully, but these errors were encountered:
I was trying to reduce the amount of prepared statements in order to work around this issue
crystal-lang/crystal-db#60
I ran into bugs with using unprepared statements. I added the following spec and it fails.
If you change db.unprepared.query to db.query it uses a prepared statement and that works fine.
The text was updated successfully, but these errors were encountered: