Documentation ¶
Index ¶
- func ColumnGoType(ct *sql.ColumnType) (reflect.Type, error)
- func EqualFold(s string) func(row Row) *drow.Field
- type Col
- type Row
- type Table
- func (d Table) Get(colName string) (Col, bool)
- func (d Table) IndexOf(k string) int
- func (d Table) Len() int
- func (d Table) MissingOn(d2 Table) Table
- func (d Table) NormalizeRows(rows []Row) []Row
- func (d Table) RowValues(rows []Row) []any
- func (d Table) StrJoin(sep string) string
- func (d Table) String() string
- func (d Table) WithColumns(col ...Col) Table
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ColumnGoType ¶
func ColumnGoType(ct *sql.ColumnType) (reflect.Type, error)
Types ¶
type Col ¶
type Col struct { Name string Type reflect.Type // RAW? ScanType Nullable bool Length int64 // for varchar and maybe other types Scale int // Precision int ... // Overrides for sql types SQLType string // override }
Col represets a column in a table
type Table ¶
type Table struct {
Columns []Col
}
Table represents an sql table definition.
func DefFromRows ¶
DefFromRows scans a slice of rows and returns a TableDef with the columns.
func DefFromSQLTypes ¶
func DefFromSQLTypes(typs []*sql.ColumnType) (Table, error)
func (Table) NormalizeRows ¶
NormalizeRows returns a slice of rows based on definition d.
func (Table) RowValues ¶
RowValues returns a slice of values from the given rows. |row1|row2|row3| => |row1[0]|row1[1]|row2[0]|row2[1]|row3[0]|row3[1]|
func (Table) WithColumns ¶
Click to show internal directories.
Click to hide internal directories.