class SQLite3::Statement

Overview

A statement represents a prepared-but-unexecuted SQL query.

Superclass hierarchy

Object
Reference
SQLite3::Statement

Instance Method Summary

Instance Method Detail

def [](index : Int)

Returns the value of the given column by index (1-based).


[View source]

def [](name : String)

Returns the value of the given column by name.


[View source]

def []=(index : Int, value : Int64)

Binds the parameter at the given index to an Int64.


[View source]

def []=(index : Int, value : Int32)

Binds the parameter at the given index to an Int32.


[View source]

def []=(index : Int, value : Nil)

Binds the parameter at the given index to an Int.


[View source]

def []=(name : String | Symbol, value)

Binds a named parameter, using the :AAAA naming scheme for parameters.


[View source]

def []=(index : Int, hash : Hash)

Binds a hash to this statement (the index is ignored).


[View source]

def []=(index : Int, value : Slice(UInt8))

Binds the parameter at the given index to a BLOB.


[View source]

def []=(index : Int, value : Float)

Binds the parameter at the given index to a Float.


[View source]

def []=(index : Int, value : String)

Binds the parameter at the given index to a String.


[View source]

def close

Closes this statement.


[View source]

def closed?

Returns true if this statement is closed. See #close.


[View source]

def column_count

Returns the number of columns in this statement.


[View source]

def column_name(index)

Returns the name of the column at the given index.


[View source]

def column_type(index : Int)

Returns the Type of the column at the given index.


[View source]

def columns

Returns the column names of this statement.


[View source]

def execute(*binds, &block)

Executes this statement with the given binds and yields a ResultSet that will be closed at the end of the block.


[View source]

def execute(binds : Enumerable | Slice(UInt8), &block)

Executes this statement with the given binds and yields a ResultSet that will be closed at the end of the block.


[View source]

def execute(binds : Slice(UInt8))

Executes this statement with a single BLOB bind and returns a ResultSet.


[View source]

def execute(binds : Enumerable)

Executes this statement with the given binds and returns a ResultSet.


[View source]

def execute(*binds)

Executes this statement with the given binds and returns a ResultSet.


[View source]

def reset

Reset this statment, allowing to re-execute it with new binds.


[View source]

def types

Returns an Array(Type) of this statement's columns. Note that the statement must be executed in order for this to return sensible values, otherwise all types will be NULL.


[View source]