class SQLite3::ResultSet

Overview

The ResultSet object encapsulates the enumerability of a query’s output. It is a simple cursor over the data that the query returns.

Typical usage is:

require "sqlite3"

db = SQLite3::Database.new("foo.db")
stmt = db.prepare("select * from person")
result_set = stmt.execute
while result_set.next
  p result_set.to_a
end
stmt.close
db.close

Superclass hierarchy

Object
Reference
SQLite3::ResultSet

Instance Method Summary

Instance Method Detail

def [](index_or_name)

Returns the value of a column by index or name.


[View source]

def close

Closes this result set, closing the associated statement.


[View source]

def closed?

Returns true if the associated statement is closed.


[View source]

def column_count

Returns the number of columns.


[View source]

def columns

Returns the names of the columns, an Array(String).


[View source]

def next

Advances to the next row. Returns true if there's a next row, false otherwise. Must be called at least once to advance to the first row.


[View source]

def to_a

Return the current row's value as an Array(Value).


[View source]

def types

Returns the types of the columns, an Array(Type).


[View source]