Skip to content

Commit a1e4842

Browse files
authored
Add source of column information (#471)
1 parent 9b48476 commit a1e4842

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
@@ -61,6 +61,7 @@
6161
- Enh #464: Load column's check expressions for table schema (@Tigrov)
6262
- Bug #467: Fix column definition parsing in cases with parentheses (@vjik)
6363
- New #465: Add enumeration column type support (@vjik)
64+
- New #471: Add source of column information (@Tigrov)
6465

6566
## 1.3.0 March 21, 2024
6667

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\Pgsql;
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;
@@ -422,7 +423,7 @@ protected function loadResultColumn(array $metadata): ?ColumnInterface
422423

423424
$dbType = $metadata['native_type'];
424425

425-
$columnInfo = ['fromResult' => true];
426+
$columnInfo = ['source' => ColumnInfoSource::QUERY_RESULT];
426427

427428
if (!empty($metadata['table'])) {
428429
$columnInfo['table'] = $metadata['table'];
@@ -534,6 +535,7 @@ private function loadColumn(array $info): ColumnInterface
534535
'scale' => $info['scale'] !== null ? (int) $info['scale'] : null,
535536
'schema' => $info['schema'],
536537
'size' => $info['size'] !== null ? (int) $info['size'] : null,
538+
'source' => ColumnInfoSource::TABLE_SCHEMA,
537539
'table' => $info['table'],
538540
'unique' => $info['contype'] === 'u',
539541
];

0 commit comments

Comments
 (0)