Sha256: ede9c06d76331e19e74ff189094e2615c66ae1ac017789aecd615aa4cfaa794c
Contents?: true
Size: 997 Bytes
Versions: 21
Compression:
Stored size: 997 Bytes
Contents
require 'uri' module Hanami module Model module Sql # SQL console # # @since 0.7.0 # @api private class Console extend Forwardable # @since 0.7.0 # @api private def_delegator :console, :connection_string # @since 0.7.0 # @api private def initialize(uri) @uri = URI.parse(uri) end private # @since 0.7.0 # @api private def console # rubocop:disable Metrics/MethodLength case @uri.scheme when 'sqlite' require 'hanami/model/sql/consoles/sqlite' Sql::Consoles::Sqlite.new(@uri) when 'postgres', 'postgresql' require 'hanami/model/sql/consoles/postgresql' Sql::Consoles::Postgresql.new(@uri) when 'mysql', 'mysql2' require 'hanami/model/sql/consoles/mysql' Sql::Consoles::Mysql.new(@uri) end end end end end end
Version data entries
21 entries across 21 versions & 1 rubygems