Sha256: d413e261bc0ce0bef6b3d60513e0e001c0617990f23ac69bfb30e961e09e5010
Contents?: true
Size: 743 Bytes
Versions: 21
Compression:
Stored size: 743 Bytes
Contents
module Astrails module Safe class Pgdump < Source def command if @config["password"] ENV['PGPASSWORD'] = @config["password"] else ENV['PGPASSWORD'] = nil end "pg_dump #{postgres_options} #{postgres_username} #{postgres_host} #{postgres_port} #{@id}" end def extension; '.sql'; end protected def postgres_options @config[:options] end def postgres_host @config["host"] && "--host='#{@config["host"]}'" end def postgres_port @config["port"] && "--port='#{@config["port"]}'" end def postgres_username @config["user"] && "--username='#{@config["user"]}'" end end end end
Version data entries
21 entries across 21 versions & 5 rubygems