Class: Ronin::DB::CLI::DatabaseCommand Private

Inherits:
Command
  • Object
show all
Includes:
URIMethods
Defined in:
lib/ronin/db/cli/database_command.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Base class for all commands that access the database.

Direct Known Subclasses

Commands::Irb, Commands::Migrate, ModelCommand

Constant Summary

Constants included from URIMethods

URIMethods::ADAPTER_ALIASES

Instance Method Summary collapse

Methods included from URIMethods

#normalize_adapter, #normalize_sqlite3_path, #parse_uri

Instance Method Details

#configHash{Symbol => String,Integer}

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

The database connection configuration.

Returns:

  • (Hash{Symbol => String,Integer})


53
54
55
56
57
58
59
# File 'lib/ronin/db/cli/database_command.rb', line 53

def config
  if options[:db_uri]
    parse_uri(options[:db_uri])
  else
    DB.config[options[:db]]
  end
end

#connectObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Connects to the database.



64
65
66
# File 'lib/ronin/db/cli/database_command.rb', line 64

def connect
  DB.connect(config)
end