lib/hanami/model/sql/console.rb in hanami-model-1.3.2 vs lib/hanami/model/sql/console.rb in hanami-model-1.3.3
- old
+ new
@@ -1,7 +1,9 @@
-require 'uri'
+# frozen_string_literal: true
+require "uri"
+
module Hanami
module Model
module Sql
# SQL console
#
@@ -22,19 +24,19 @@
private
# @since 0.7.0
# @api private
- def console # rubocop:disable Metrics/MethodLength
+ def console
case @uri.scheme
- when 'sqlite'
- require 'hanami/model/sql/consoles/sqlite'
+ when "sqlite"
+ require "hanami/model/sql/consoles/sqlite"
Sql::Consoles::Sqlite.new(@uri)
- when 'postgres', 'postgresql'
- require 'hanami/model/sql/consoles/postgresql'
+ when "postgres", "postgresql"
+ require "hanami/model/sql/consoles/postgresql"
Sql::Consoles::Postgresql.new(@uri)
- when 'mysql', 'mysql2'
- require 'hanami/model/sql/consoles/mysql'
+ when "mysql", "mysql2"
+ require "hanami/model/sql/consoles/mysql"
Sql::Consoles::Mysql.new(@uri)
end
end
end
end