Sha256: b57520d9cd09633a14dbb5e2e2db86890447258ee04a864a09e7e883582f5b0a

Contents?: true

Size: 796 Bytes

Versions: 3

Compression:

Stored size: 796 Bytes

Contents

require 'hanami/utils/class'
require 'hanami/commands/command'

module Hanami
  module Commands
    # @api private
    class DB
      # @api private
      class Console < Command
        requires 'model.sql'

        # @api private
        def initialize(options, name)
          super(options)
          @name = name
        end

        # @api private
        def start
          exec console.connection_string
        end

        private

        # @api private
        attr_reader :name

        # @api private
        def configuration
          Hanami::Components['model.configuration']
        end

        # @api private
        def console
          require 'hanami/model/sql/console'
          Hanami::Model::Sql::Console.new(configuration.url)
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
hanami-1.0.0 lib/hanami/commands/db/console.rb
hanami-1.0.0.rc1 lib/hanami/commands/db/console.rb
hanami-1.0.0.beta3 lib/hanami/commands/db/console.rb