Skip to content

Commit 33852d0

Browse files
committed
Small fixes
1 parent 43f4000 commit 33852d0

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/Tqdev/PhpCrudApi/Column/Reflection/ReflectedColumn.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,11 @@ public static function fromJson(/* object */$json): ReflectedColumn
9191
{
9292
$name = $json->name;
9393
$type = $json->type;
94-
$length = isset($json->length) ? $json->length : 0;
95-
$precision = isset($json->precision) ? $json->precision : 0;
96-
$scale = isset($json->scale) ? $json->scale : 0;
97-
$nullable = isset($json->nullable) ? $json->nullable : false;
98-
$pk = isset($json->pk) ? $json->pk : false;
94+
$length = isset($json->length) ? (int) $json->length : 0;
95+
$precision = isset($json->precision) ? (int) $json->precision : 0;
96+
$scale = isset($json->scale) ? (int) $json->scale : 0;
97+
$nullable = isset($json->nullable) ? (bool) $json->nullable : false;
98+
$pk = isset($json->pk) ? (bool) $json->pk : false;
9999
$fk = isset($json->fk) ? $json->fk : '';
100100
return new ReflectedColumn($name, $type, $length, $precision, $scale, $nullable, $pk, $fk);
101101
}

src/Tqdev/PhpCrudApi/Database/TypeConverter.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ public function __construct(string $driver)
4343
'smallint' => 'integer',
4444
'real' => 'float',
4545
'numeric' => 'decimal',
46+
'nclob' => 'clob',
4647
'time_with_timezone' => 'time',
4748
'timestamp_with_timezone' => 'timestamp',
4849
],
@@ -135,7 +136,7 @@ public function __construct(string $driver)
135136
//'datalink' => true,
136137
'date' => true,
137138
'decimal' => true,
138-
'distinct' => true,
139+
//'distinct' => true,
139140
'double' => true,
140141
'float' => true,
141142
'integer' => true,

0 commit comments

Comments
 (0)