Sha256: d09f39270c84ae8708d6a8341d12b434f8cfa44ec279f180bb4c76d17cc031b0

Contents?: true

Size: 641 Bytes

Versions: 5

Compression:

Stored size: 641 Bytes

Contents

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

module Hanami
  module Commands
    class DB
      class Console < Command
        requires 'model.sql'

        def initialize(options, name)
          super(options)
          @name = name
        end

        def start
          exec console.connection_string
        end

        private

        attr_reader :name

        def configuration
          Hanami::Components['model.configuration']
        end

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

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
hanami-1.0.0.beta2 lib/hanami/commands/db/console.rb
hanami-1.0.0.beta1 lib/hanami/commands/db/console.rb
hanami-0.9.2 lib/hanami/commands/db/console.rb
hanami-0.9.1 lib/hanami/commands/db/console.rb
hanami-0.9.0 lib/hanami/commands/db/console.rb