Class Index [+]

Quicksearch

Sequel::Postgres::StatementCache::DatabaseMethods

Public Class Methods

extended(db) click to toggle source

Setup the after_connect proc for the connection pool to make sure the connection object is extended with the appropriate module. This disconnects any existing connections to ensure that all connections in the pool have been extended appropriately.

     # File lib/sequel/extensions/pg_statement_cache.rb, line 277
277:         def self.extended(db)
278:           # Respect existing after_connect proc if one is present
279:           pr = db.opts[:after_connect]
280: 
281:           # Set the after_connect proc to extend the adapter with
282:           # the statement cache support.
283:           db.pool.after_connect = db.opts[:after_connect] = proc do |c|
284:             pr.call(c) if pr
285:             c.extend(AdapterMethods)
286:           end
287: 
288:           # Disconnect to make sure all connections get set up with
289:           # statement cache.
290:           db.disconnect
291:         end

Public Instance Methods

alter_table(*) click to toggle source

Clear statement caches for all connections when altering tables.

     # File lib/sequel/extensions/pg_statement_cache.rb, line 294
294:         def alter_table(*)
295:           clear_statement_caches
296:           super
297:         end
drop_table(*) click to toggle source

Clear statement caches for all connections when dropping tables.

     # File lib/sequel/extensions/pg_statement_cache.rb, line 300
300:         def drop_table(*)
301:           clear_statement_caches
302:           super
303:         end

Private Instance Methods

clear_statement_caches() click to toggle source

Clear the statement cache for all connections. Note that for the threaded pools, this will not affect connections currently allocated to other threads.

     # File lib/sequel/extensions/pg_statement_cache.rb, line 310
310:         def clear_statement_caches
311:           pool.all_connections{|c| c.statement_cache.clear}
312:         end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.