class Tablature::Adapters::Postgres::Connection
Decorates an ActiveRecord connection with methods that help determine the connections capabilities.
Every attempt is made to use the versions of these methods defined by Rails where they are available and public before falling back to our own implementations for older Rails versions.
@api private
Public Instance Methods
postgresql_version()
click to toggle source
An integer representing the version of Postgres
we're connected to.
postgresql_version
is public in Rails 5, but protected in earlier versions.
@return [Integer]
Calls superclass method
# File lib/tablature/adapters/postgres/connection.rb, line 40 def postgresql_version if undecorated_connection.respond_to?(:postgresql_version) super else undecorated_connection.send(:postgresql_version) end end
supports_hash_partitions?()
click to toggle source
True if the connection supports hash partitions.
@return [Boolean]
# File lib/tablature/adapters/postgres/connection.rb, line 30 def supports_hash_partitions? postgresql_version >= 110_000 end
supports_list_partitions?()
click to toggle source
True if the connection supports list partitions.
@return [Boolean]
# File lib/tablature/adapters/postgres/connection.rb, line 23 def supports_list_partitions? postgresql_version >= 100_000 end
supports_range_partitions?()
click to toggle source
True if the connection supports range partitions.
@return [Boolean]
# File lib/tablature/adapters/postgres/connection.rb, line 16 def supports_range_partitions? postgresql_version >= 100_000 end
Private Instance Methods
undecorated_connection()
click to toggle source
# File lib/tablature/adapters/postgres/connection.rb, line 50 def undecorated_connection __getobj__ end