sq/libsq/core/sqlz/sqlz_test.go

26 lines
552 B
Go
Raw Normal View History

2020-08-06 20:58:47 +03:00
package sqlz_test
import (
"database/sql"
"reflect"
"github.com/neilotoole/sq/libsq/core/record"
2020-08-06 20:58:47 +03:00
)
// stdlibColumnType exists to verify that sql.ColumnType
// and FieldMeta conform to a common (sql.ColumnType's)
// method set.
type stdlibColumnType interface {
Name() string
Length() (length int64, ok bool)
DecimalSize() (precision, scale int64, ok bool)
ScanType() reflect.Type
Nullable() (nullable, ok bool)
DatabaseTypeName() string
}
var (
_ stdlibColumnType = (*sql.ColumnType)(nil)
_ stdlibColumnType = (*record.FieldMeta)(nil)
)