@@ -17,8 +17,8 @@ |
||
| 17 | 17 | public $timeout; |
| 18 | 18 | |
| 19 | 19 | /** |
| 20 | - * @inheritDoc |
|
| 21 | - */ |
|
| 20 | + * @inheritDoc |
|
| 21 | + */ |
|
| 22 | 22 | public function open(string $database, string $schema = '') |
| 23 | 23 | { |
| 24 | 24 | $server = str_replace(":", "' port='", addcslashes($this->driver->options('server'), "'\\")); |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | // Init config |
| 16 | 16 | $this->config->jush = 'pgsql'; |
| 17 | 17 | $this->config->drivers = ["PgSQL", "PDO_PgSQL"]; |
| 18 | - $this->config->setTypes([ //! arrays |
|
| 18 | + $this->config->setTypes([//! arrays |
|
| 19 | 19 | 'Numbers' => ["smallint" => 5, "integer" => 10, "bigint" => 19, "boolean" => 1, |
| 20 | 20 | "numeric" => 0, "real" => 7, "double precision" => 16, "money" => 20], |
| 21 | 21 | 'Date and time' => ["date" => 13, "time" => 17, "timestamp" => 20, "timestamptz" => 21, "interval" => 0], |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | $this->config->editFunctions = [[ |
| 35 | 35 | "char" => "md5", |
| 36 | 36 | "date|time" => "now", |
| 37 | - ],[ |
|
| 37 | + ], [ |
|
| 38 | 38 | $this->numberRegex() => "+/-", |
| 39 | 39 | "date|time" => "+ interval/- interval", //! escape |
| 40 | 40 | "char|text" => "||", |
@@ -178,7 +178,7 @@ |
||
| 178 | 178 | */ |
| 179 | 179 | public function truncateTables(array $tables) |
| 180 | 180 | { |
| 181 | - $this->driver->execute('TRUNCATE ' . implode(', ', array_map(function ($table) { |
|
| 181 | + $this->driver->execute('TRUNCATE ' . implode(', ', array_map(function($table) { |
|
| 182 | 182 | return $this->driver->escapeTableName($table); |
| 183 | 183 | }, $tables))); |
| 184 | 184 | return true; |
@@ -18,9 +18,7 @@ |
||
| 18 | 18 | */ |
| 19 | 19 | protected function limitToOne(string $table, string $query, string $where) |
| 20 | 20 | { |
| 21 | - return (preg_match('~^INTO~', $query) ? $this->driver->getLimitClause($query, $where, 1, 0) : |
|
| 22 | - " $query" . ($this->driver->isView($this->driver->tableStatusOrName($table)) ? $where : |
|
| 23 | - " WHERE ctid = (SELECT ctid FROM " . $this->driver->escapeTableName($table) . $where . ' LIMIT 1)')); |
|
| 21 | + return (preg_match('~^INTO~', $query) ? $this->driver->getLimitClause($query, $where, 1, 0) : " $query" . ($this->driver->isView($this->driver->tableStatusOrName($table)) ? $where : " WHERE ctid = (SELECT ctid FROM " . $this->driver->escapeTableName($table) . $where . ' LIMIT 1)')); |
|
| 24 | 22 | } |
| 25 | 23 | |
| 26 | 24 | /** |