No way to check column type by column name
nussjustin opened this issue · comments
When writing functions that want to check the type of a column (via (*Stmt).ColumnType
) users need to know the index of the column since there is no way to get the index for a column by its name. This is inconvenient and error prone since column indexes depend on the order of columns in a query and can easily be forgotten when changing a query.
Possible solutions:
- Add a variant of
ColumnType
that takes a column name - Add a method to return the index for a column by its name