Skip to content

Commit c45a248

Browse files
authored
Add source of column information (#408)
1 parent 5d00b89 commit c45a248

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
- Chg #391: Update expression namespaces according to changes in `yiisoft/db` package (@Tigrov)
5555
- Chg #402: Throw exception on "unsigned" column usage (@vjik)
5656
- New #404: Add enumeration column type support (@vjik)
57+
- New #408: Add source of column information (@Tigrov)
5758

5859
## 1.2.0 March 21, 2024
5960

src/Schema.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace Yiisoft\Db\Sqlite;
66

7+
use Yiisoft\Db\Constant\ColumnInfoSource;
78
use Yiisoft\Db\Constant\ColumnType;
89
use Yiisoft\Db\Constant\ReferentialAction;
910
use Yiisoft\Db\Constraint\Check;
@@ -291,7 +292,7 @@ protected function loadResultColumn(array $metadata): ?ColumnInterface
291292

292293
$dbType = $metadata['sqlite:decl_type'] ?? $metadata['native_type'];
293294

294-
$columnInfo = ['fromResult' => true];
295+
$columnInfo = ['source' => ColumnInfoSource::QUERY_RESULT];
295296

296297
if (!empty($metadata['table'])) {
297298
$columnInfo['table'] = $metadata['table'];
@@ -331,6 +332,7 @@ private function loadColumn(array $info, array $checks): ColumnInterface
331332
'notNull' => (bool) $info['notnull'],
332333
'primaryKey' => (bool) $info['pk'],
333334
'schema' => $info['schema'],
335+
'source' => ColumnInfoSource::TABLE_SCHEMA,
334336
'table' => $info['table'],
335337
'values' => $this->tryGetEnumValuesFromCheck($info['name'], $checks),
336338
]);

0 commit comments

Comments
 (0)