Skip to content

Commit

Permalink
fix: Handling missing or bad ordered datatype annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
vlastahajek committed Apr 29, 2020
1 parent 88d1113 commit 6ac10dc
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion query.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ readRow:
goto readRow
}
if q.table == nil {
q.err = errors.New("parsing error, table definition not found")
q.err = errors.New("parsing error, datatype annotation not found")
return false
}
if len(row)-1 != len(q.table.Columns()) {
Expand All @@ -302,13 +302,21 @@ readRow:
}
goto readRow
case "#group":
if q.table == nil {
q.err = errors.New("parsing error, datatype annotation not found")
return false
}
for i, g := range row[1:] {
if q.table.Column(i) != nil {
q.table.Column(i).SetGroup(g == "true")
}
}
goto readRow
case "#default":
if q.table == nil {
q.err = errors.New("parsing error, datatype annotation not found")
return false
}
for i, c := range row[1:] {
if q.table.Column(i) != nil {
q.table.Column(i).SetDefaultValue(c)
Expand Down

0 comments on commit 6ac10dc

Please sign in to comment.