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.

5 calls to _drush_sql_connect()
drush_sql_build_dump_command in commands/sql/sql.drush.inc
Build a mysqldump/pg_dump/sqlite statement.
drush_sql_cli in commands/sql/sql.drush.inc
drush_sql_connect in commands/sql/sql.drush.inc
drush_sql_sync in commands/sql/sync.sql.inc
_drush_sql_drop in commands/sql/sql.drush.inc

File

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

Code

function _drush_sql_connect($db_spec = NULL) {
  switch (_drush_sql_get_scheme($db_spec)) {
    case 'mysql':
      $command = 'mysql';
      break;
    case 'pgsql':
      $command = 'psql';
      break;
    case 'sqlite':
      $command = 'sqlite3';
      break;
  }
  $command .= _drush_sql_get_credentials($db_spec);
  return $command;
}