Step through multiple row results

This commit is contained in:
Tom Richards 2017-09-14 12:44:18 -04:00
parent 7478bc854b
commit d18bf51109

View file

@ -19,7 +19,11 @@ class SQLite3::Statement < DB::Statement
end end
# exec # exec
step = nil
loop do
step = LibSQLite3::Code.new LibSQLite3.step(self) step = LibSQLite3::Code.new LibSQLite3.step(self)
break unless step == LibSQLite3::Code::ROW
end
raise Exception.new(sqlite3_connection) unless step == LibSQLite3::Code::DONE raise Exception.new(sqlite3_connection) unless step == LibSQLite3::Code::DONE
rows_affected = LibSQLite3.changes(sqlite3_connection).to_i64 rows_affected = LibSQLite3.changes(sqlite3_connection).to_i64