Class: ActivePostgres::Components::Extensions
- Inherits:
-
Base
- Object
- Base
- ActivePostgres::Components::Extensions
show all
- Defined in:
- lib/active_postgres/components/extensions.rb
Constant Summary
collapse
- EXTENSION_PACKAGES =
{
'pgvector' => 'postgresql-{version}-pgvector',
'postgis' => 'postgresql-{version}-postgis-3',
'pg_trgm' => nil, 'hstore' => nil, 'uuid-ossp' => nil, 'ltree' => nil, 'citext' => nil, 'unaccent' => nil, 'pg_stat_statements' => nil, 'timescaledb' => 'timescaledb-2-postgresql-{version}',
'citus' => 'postgresql-{version}-citus-12.1',
'pg_partman' => 'postgresql-{version}-partman'
}.freeze
Instance Attribute Summary
Attributes inherited from Base
#config, #secrets, #ssh_executor
Instance Method Summary
collapse
Methods inherited from Base
#initialize
Instance Method Details
#install ⇒ Object
19
20
21
22
23
24
25
26
27
28
29
30
|
# File 'lib/active_postgres/components/extensions.rb', line 19
def install
extensions_config = config.component_config(:extensions)
return unless extensions_config[:enabled]
extensions = extensions_config[:list] || []
return if extensions.empty?
puts 'Installing PostgreSQL extensions...'
install_on_primary(extensions)
install_on_standbys(extensions) if config.standbys.any?
end
|
#install_on_standby(standby_host) ⇒ Object
40
41
42
43
44
45
46
47
48
49
|
# File 'lib/active_postgres/components/extensions.rb', line 40
def install_on_standby(standby_host)
extensions_config = config.component_config(:extensions)
return unless extensions_config[:enabled]
extensions = extensions_config[:list] || []
return if extensions.empty?
puts "Installing extension packages on standby #{standby_host}..."
install_packages_on_host(standby_host, extensions)
end
|
#restart ⇒ Object
36
37
38
|
# File 'lib/active_postgres/components/extensions.rb', line 36
def restart
puts 'Extensions do not require restart (loaded at database connection time)'
end
|
#uninstall ⇒ Object
32
33
34
|
# File 'lib/active_postgres/components/extensions.rb', line 32
def uninstall
puts 'Extensions uninstall not implemented (extensions remain in database)'
end
|