Sha256: 12a6ba9e720be0d715a3d83a61d76f0b40821cd96cd2bb70e2a3eb35a500534b
Contents?: true
Size: 996 Bytes
Versions: 8
Compression:
Stored size: 996 Bytes
Contents
require 'shellwords' module Lotus module Model module Adapters module Sql module Consoles class Postgresql def initialize(uri) @uri = uri end def connection_string configure_password str = 'psql' str << host str << database str << port if port str << username if username str end private def host " -h #{@uri.host}" end def database " -d #{@uri.path.sub(/^\//, '')}" end def port " -p #{@uri.port}" if @uri.port end def username " -U #{@uri.user}" if @uri.user end def configure_password ENV['PGPASSWORD'] = @uri.password if @uri.password end end end end end end end
Version data entries
8 entries across 8 versions & 1 rubygems