lib/hanami/model/sql/consoles/postgresql.rb in hanami-model-1.3.2 vs lib/hanami/model/sql/consoles/postgresql.rb in hanami-model-1.3.3

- old
+ new

@@ -1,8 +1,10 @@ -require_relative 'abstract' -require 'cgi' +# frozen_string_literal: true +require_relative "abstract" +require "cgi" + module Hanami module Model module Sql module Consoles # PostgreSQL adapter @@ -10,15 +12,15 @@ # @since 0.7.0 # @api private class Postgresql < Abstract # @since 0.7.0 # @api private - COMMAND = 'psql'.freeze + COMMAND = "psql" # @since 0.7.0 # @api private - PASSWORD = 'PGPASSWORD'.freeze + PASSWORD = "PGPASSWORD" # @since 0.7.0 # @api private def connection_string configure_password @@ -46,25 +48,25 @@ end # @since 0.7.0 # @api private def port - port = query['port'] || @uri.port + port = query["port"] || @uri.port " -p #{port}" if port end # @since 0.7.0 # @api private def username - username = query['user'] || @uri.user + username = query["user"] || @uri.user " -U #{username}" if username end # @since 0.7.0 # @api private def configure_password - password = query['password'] || @uri.password - ENV[PASSWORD] = CGI.unescape(query['password'] || @uri.password) if password + password = query["password"] || @uri.password + ENV[PASSWORD] = CGI.unescape(query["password"] || @uri.password) if password end # @since 1.1.0 # @api private def query