Skip to content

Commit 871bfee

Browse files
committed
🚿
1 parent 362c3ec commit 871bfee

File tree

5 files changed

+7
-44
lines changed

5 files changed

+7
-44
lines changed

examples/common.php

-37
This file was deleted.

src/Dialects/Postgres.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -191,11 +191,11 @@ public function fieldspec(
191191
if($defaultType === 'USER_DEFINED'){
192192

193193
$field[] = match (true) {
194-
$type === 'TIMESTAMP' && intval($defaultValue) === 0 => 'DEFAULT 0',
195-
$type === 'BIT' || $type === 'VARBIT' => 'DEFAULT b\''.preg_replace('/[^01]/', '0', $defaultValue).'\'',
196-
$type === 'BOOLEAN' => 'DEFAULT '.(preg_match('/^1|T|TRUE|YES$/i', $defaultValue) ? 'TRUE' : 'FALSE'),
197-
strtoupper($defaultValue) === 'NULL' && $isNull === true => 'DEFAULT NULL',
198-
default => 'DEFAULT \''.$defaultValue.'\'',
194+
$type === 'TIMESTAMP' && intval($defaultValue) === 0 => 'DEFAULT 0',
195+
$type === 'BIT' || $type === 'VARBIT' => 'DEFAULT b\''.preg_replace('/[^01]/', '0', $defaultValue).'\'',
196+
$type === 'BOOLEAN' => 'DEFAULT '.(preg_match('/^1|T|TRUE|YES$/i', $defaultValue) ? 'TRUE' : 'FALSE'),
197+
strtoupper((string)$defaultValue) === 'NULL' && $isNull === true => 'DEFAULT NULL',
198+
default => 'DEFAULT \''.$defaultValue.'\'',
199199
};
200200

201201
}

src/Drivers/DriverAbstract.php

+1
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ public function __construct(
7171
){
7272
$this->options = $options;
7373
$this->cache = $cache;
74+
/** @phan-suppress-next-line PhanEmptyFQSENInClasslike, PhanTypeExpectedObjectOrClassName */
7475
$this->dialect = new (static::DIALECT);
7576

7677
$this->setLogger($logger);

src/Drivers/DriverInterface.php

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
namespace chillerlan\Database\Drivers;
1313

14-
use chillerlan\Database\Dialects\Dialect;
1514
use chillerlan\Database\Result;
1615
use chillerlan\Settings\SettingsContainerInterface;
1716
use Closure;

src/Query/Update.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function set(array $set, bool|null $bind = null):static{
6161

6262
foreach($set as $k => $v){
6363

64-
if($v instanceof Statement){
64+
if($v instanceof Query){
6565
$this->set[] = $this->dialect->quote($k).' = ('.$v->getSQL().')';
6666

6767
if($v instanceof BindValues){

0 commit comments

Comments
 (0)