class MultitenancyTools::Dump::SchemaOnly
Public Class Methods
new(options)
click to toggle source
# File lib/multitenancy_tools/dump/schema_only.rb, line 6 def initialize(options) @schema = options.fetch(:schema) @database = options.fetch(:database) @host = options.fetch(:host, nil) @user = options.fetch(:username, nil) end
Public Instance Methods
dump()
click to toggle source
# File lib/multitenancy_tools/dump/schema_only.rb, line 13 def dump Open3.capture3(dump_args.shelljoin) end
Private Instance Methods
dump_args()
click to toggle source
# File lib/multitenancy_tools/dump/schema_only.rb, line 19 def dump_args args = [ 'pg_dump', '--schema', @schema, '--schema-only', '--no-privileges', '--no-tablespaces', '--no-owner', '--dbname', @database, ] args << ['--host', @host] if @host.present? args << ['--username', @user] if @user.present? args.flatten end