abstract class DB::Statement

Overview

Represents a query in a Connection. It should be created by QueryMethods.

Note to implementors

  1. Subclass Statements
  2. Statements are created from a custom driver Connection#prepare method.
  3. #perform_query executes a query that is expected to return a ResultSet
  4. #perform_exec executes a query that is expected to return an ExecResult
  5. #do_close is called to release the statement resources.

Included Modules

Defined in:

db/statement.cr

Constructors

Instance Method Summary

Instance methods inherited from module DB::StatementMethods

exec : ExecResult
exec(*args_, args : Array | Nil = nil) : ExecResult
exec
, query(*args_, args : Array | Nil = nil, &)
query : ResultSet
query(*args_, args : Array | Nil = nil) : ResultSet
query
, scalar(*args_, args : Array | Nil = nil) scalar

Instance methods inherited from module DB::Disposable

close close, closed? closed?

Constructor Detail

def self.new(connection : Connection) #

[View source]

Instance Method Detail

def exec : DB::ExecResult #

[View source]
def exec(*args_, args : Array | Nil = nil) : DB::ExecResult #

[View source]
def query : DB::ResultSet #

[View source]
def query(*args_, args : Array | Nil = nil) : DB::ResultSet #

[View source]
def release_connection #

[View source]