Skip to content

Instantly share code, notes, and snippets.

@lcube45
Created May 11, 2017 12:25
Show Gist options
  • Save lcube45/7c0d7a4fe0abb0d9228b4bb8a0d86cd1 to your computer and use it in GitHub Desktop.
Save lcube45/7c0d7a4fe0abb0d9228b4bb8a0d86cd1 to your computer and use it in GitHub Desktop.
Drush with PostGreSql on Windows
<?php
namespace Drush\Sql;
define('PSQL_SHOW_TABLES', "SELECT tablename FROM pg_tables WHERE schemaname='public';");
class Sqlpgsql extends SqlBase {
//public $query_extra = "--no-align --field-separator=\"\t\" --pset tuples_only=on";
public $query_extra = "--no-align --pset tuples_only=on";
...
public function command() {
$environment = "";
$pw_file = $this->password_file();
if (isset($pw_file)) {
//$environment = "PGPASSFILE={$pw_file} ";
$environment = "SET PGPASSFILE={$pw_file} & ";
}
return "{$environment}psql -q";
}
...
}
@lcube45
Copy link
Author

lcube45 commented May 11, 2017

changed version

@lcube45
Copy link
Author

lcube45 commented May 11, 2017

taking from a pull request drush-ops/drush@7f5c13f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment