Skip to content

SQL driver ScanType() returns empty interface #108

@clarkmcc

Description

@clarkmcc

When I run the following code, the ScanType() always returns an empty interface

rows, err := db.QueryContext(ctx, query)
if err != nil {
	return nil, err
}
types, err := rows.ColumnTypes()
if err != nil {
	return nil, err
}
types[0].ScanType() // interface{}

Go doc says

// ScanType returns a Go type suitable for scanning into using [Rows.Scan].
// If a driver does not support this property ScanType will return
// the type of an empty interface.
func (ci *ColumnType) ScanType() reflect.Type

which would indicate that maybe this library doesn't support this functionality. Can it be supported?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions