Class: DB::Context::Session

Inherits:
Generic
  • Object
show all
Defined in:
lib/db/context/session.rb

Overview

A connected context for sending queries and reading results.

Direct Known Subclasses

Transaction

Instance Method Summary collapse

Methods inherited from Generic

#clause, #close, #connection, #connection?, #initialize, #query

Constructor Details

This class inherits a constructor from DB::Context::Generic

Instance Method Details

#call(statement, **options) {|connection| ... } ⇒ Object

Send a query to the server.

Yields:


31
32
33
34
35
36
37
# File 'lib/db/context/session.rb', line 31

def call(statement, **options)
	connection = self.connection
	
	connection.send_query(statement, **options)
	
	yield connection if block_given?
end