2020-08-06 20:58:47 +03:00
|
|
|
package sqlz_test
|
|
|
|
|
|
|
|
import (
|
|
|
|
"database/sql"
|
|
|
|
"reflect"
|
|
|
|
|
2023-05-22 18:08:14 +03:00
|
|
|
"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
|
|
|
|
}
|
|
|
|
|
2022-12-18 11:35:59 +03:00
|
|
|
var (
|
|
|
|
_ stdlibColumnType = (*sql.ColumnType)(nil)
|
2023-05-22 18:08:14 +03:00
|
|
|
_ stdlibColumnType = (*record.FieldMeta)(nil)
|
2022-12-18 11:35:59 +03:00
|
|
|
)
|