mirror of
https://github.com/ent/ent.git
synced 2026-05-01 07:00:57 +03:00
fix: checks for error after rows.Next call (#480)
This commit is contained in:
@@ -168,6 +168,9 @@ func (d *SQLite) table(ctx context.Context, tx dialect.Tx, name string) (*Table,
|
||||
}
|
||||
t.AddColumn(c)
|
||||
}
|
||||
if rows.Err() != nil {
|
||||
return nil, rows.Err()
|
||||
}
|
||||
if err := rows.Close(); err != nil {
|
||||
return nil, fmt.Errorf("sqlite: closing rows %v", err)
|
||||
}
|
||||
@@ -215,6 +218,9 @@ func (d *SQLite) indexes(ctx context.Context, tx dialect.Tx, name string) (Index
|
||||
i.primary = origin.String == "pk"
|
||||
idx = append(idx, i)
|
||||
}
|
||||
if rows.Err() != nil {
|
||||
return nil, rows.Err()
|
||||
}
|
||||
if err := rows.Close(); err != nil {
|
||||
return nil, fmt.Errorf("closing rows %v", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user