Sha256: 2ea49c5acaaf8ab8c9e2066b10ebd6634349b9fc68326fef4ca50a125576477e

Contents?: true

Size: 649 Bytes

Versions: 2

Compression:

Stored size: 649 Bytes

Contents

module SequelRails
  module Storage
    class Postgres < Abstract
      def _create
        ENV["PGPASSWORD"] = password unless password.blank?
        commands = ["createdb", "--encoding", charset]
        commands << "--username" << username unless username.blank?
        commands << "--owner" << owner unless owner.blank?
        commands << "--port" << port unless port.blank?
        commands << "--host" << host unless host.blank?
        commands << database
        res = system(*commands)
        ENV["PGPASSWORD"] = nil
        res
      end

      def _drop
        system("dropdb", "-U", username, database)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
sequel-rails-0.4.0.pre1 lib/sequel_rails/storage/postgres.rb
sequel-rails-0.4.0.pre lib/sequel_rails/storage/postgres.rb