Skip to content

Commit 95a099f

Browse files
committed
Improve declType detection.
1 parent 182de39 commit 95a099f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

internal/engine/sqlite/analyzer/analyze.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ func (a *Analyzer) Analyze(ctx context.Context, n ast.Node, query string, migrat
8888
colCount := stmt.ColumnCount()
8989
for i := 0; i < colCount; i++ {
9090
name := stmt.ColumnName(i)
91+
declType := stmt.ColumnDeclType(i)
9192
dbName := stmt.ColumnDatabaseName(i)
9293
tableName := stmt.ColumnTableName(i)
9394
originName := stmt.ColumnOriginName(i)
@@ -96,14 +97,13 @@ func (a *Analyzer) Analyze(ctx context.Context, n ast.Node, query string, migrat
9697
var notNull bool
9798
var dataType string
9899
if originName != "" {
99-
var declType string
100100
declType, _, notNull, _, _, _ = a.conn.TableColumnMetadata(
101101
dbName, tableName, originName)
102-
103-
// Normalize the data type
104-
dataType = normalizeType(declType)
105102
}
106103

104+
// Normalize the data type
105+
dataType = normalizeType(declType)
106+
107107
col := &core.Column{
108108
Name: name,
109109
OriginalName: originName,

0 commit comments

Comments
 (0)