class ManageIQ::PostgresHaAdmin::PglogicalConfigHandler
Attributes
conn_info[R]
subscription[R]
Public Class Methods
new(options = {})
click to toggle source
# File lib/manageiq/postgres_ha_admin/config_handler/pglogical_config_handler.rb, line 9 def initialize(options = {}) @subscription = options[:subscription] @conn_info = options[:conn_info] end
Public Instance Methods
name()
click to toggle source
# File lib/manageiq/postgres_ha_admin/config_handler/pglogical_config_handler.rb, line 14 def name "pglogical subscription #{subscription} Config Handler" end
read()
click to toggle source
# File lib/manageiq/postgres_ha_admin/config_handler/pglogical_config_handler.rb, line 18 def read conn = PG::Connection.open(@conn_info) dsn = conn.exec_params(<<~SQL, [@subscription]).first["if_dsn"] SELECT if_dsn FROM pglogical.subscription s JOIN pglogical.node_interface i ON s.sub_origin_if = i.if_id WHERE s.sub_name = $1 SQL PG::DSNParser.new.parse(dsn) end
write(_params)
click to toggle source
# File lib/manageiq/postgres_ha_admin/config_handler/pglogical_config_handler.rb, line 30 def write(_params) # Nothing to do here as the expectation is that the user will # remove and re-add the subscription in the after failover callback end