Class: Bricolage::PostgresConnection::Cursor
- Inherits:
-
Object
- Object
- Bricolage::PostgresConnection::Cursor
- Defined in:
- lib/bricolage/postgresconnection.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #each_result_set(fetch_size = 5000) ⇒ Object
-
#initialize(name, conn, logger) ⇒ Cursor
constructor
A new instance of Cursor.
Constructor Details
#initialize(name, conn, logger) ⇒ Cursor
Returns a new instance of Cursor.
223 224 225 226 227 |
# File 'lib/bricolage/postgresconnection.rb', line 223 def initialize(name, conn, logger) @name = name @conn = conn @logger = logger end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
229 230 231 |
# File 'lib/bricolage/postgresconnection.rb', line 229 def name @name end |
Instance Method Details
#each_result_set(fetch_size = 5000) ⇒ Object
231 232 233 234 235 236 237 238 |
# File 'lib/bricolage/postgresconnection.rb', line 231 def each_result_set(fetch_size = 5000) while true @conn.execute_query("fetch #{fetch_size} in #{@name}") {|rs| return if rs.values.empty? yield rs } end end |