function _drush_sql_connect

6.x sql.drush.inc _drush_sql_connect($db_spec = NULL)
3.x sql.drush.inc _drush_sql_connect($db_spec = NULL)
4.x sql.drush.inc _drush_sql_connect($db_spec = NULL)
5.x sql.drush.inc _drush_sql_connect($db_spec = NULL)

Command callback. Emits a connect string for mysql or pgsql.

2 calls to _drush_sql_connect()

File

commands/sql/sql.drush.inc, line 161
Drush sql commands

Code

function _drush_sql_connect($db_spec = NULL) {
  switch (_drush_sql_get_scheme($db_spec)) {
    case 'mysql':
      $command = 'mysql ' . (drush_get_context('DRUSH_DEBUG') ? ' -v' : '');
      $command .= _drush_sql_get_credentials($db_spec);
      break;
    case 'pgsql':
      $command = 'psql';
      $command .= _drush_sql_get_credentials($db_spec);
      break;
  }
  return $command;
}