Documentation
¶
Index ¶
- func ColDbType(dbType string) func(o *ColumnOptions)
- func Format(format func(value any) string) func(o *ColumnOptions)
- type Column
- func NewBitmapColumn[T comparable](name string, initialCapacity int, getDefaultVal func() T, ...) Column[T]
- func NewBoolColumn(name string, options ...ColumnOption) Column[bool]
- func NewColumn[T any](name string, defaultValue T, options ...ColumnOption) Column[any]
- func NewTypedColumn[T any](name string, defaultValue T, options ...ColumnOption) Column[T]
- func UntypedCol[T any](c Column[T]) Column[any]
- type ColumnAccessor
- type ColumnOption
- type ColumnOptions
- type ColumnarRecordset
- func (c *ColumnarRecordset) Columns() (columns []Column[any])
- func (c *ColumnarRecordset) ColumnsCount() int
- func (c *ColumnarRecordset) GetColumnByIndex(i int) Column[any]
- func (c *ColumnarRecordset) GetColumnByName(name string) Column[any]
- func (c *ColumnarRecordset) GetColumnIndex(name string) int
- func (rs *ColumnarRecordset) GetRow(i int) Row
- func (rs *ColumnarRecordset) Name() string
- func (rs *ColumnarRecordset) NewRow() Row
- func (rs *ColumnarRecordset) RowsCount() int
- type Option
- type Options
- type Recordset
- type Row
- type Type
- type UntypedColWrapper
- func (c UntypedColWrapper[T]) Add(value any) error
- func (c UntypedColWrapper[T]) DbType() string
- func (c UntypedColWrapper[T]) DefaultValue() (value any)
- func (c UntypedColWrapper[T]) GetValue(row int) (value any, err error)
- func (c UntypedColWrapper[T]) IsBitmap() bool
- func (c UntypedColWrapper[T]) Name() string
- func (c UntypedColWrapper[T]) SetValue(row int, value any) (err error)
- func (c UntypedColWrapper[T]) TypedColumn() Column[T]
- func (c UntypedColWrapper[T]) ValueType() reflect.Type
- func (c UntypedColWrapper[T]) Values() []any
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ColDbType ¶ added in v0.39.0
func ColDbType(dbType string) func(o *ColumnOptions)
func Format ¶ added in v0.35.0
func Format(format func(value any) string) func(o *ColumnOptions)
Types ¶
type Column ¶
type Column[T any] interface { Name() string DefaultValue() T GetValue(row int) (value T, err error) SetValue(row int, value T) (err error) DbType() string ValueType() reflect.Type IsBitmap() bool Add(value T) error Values() []T }
func NewBitmapColumn ¶ added in v0.32.0
func NewBitmapColumn[T comparable](name string, initialCapacity int, getDefaultVal func() T, options ...ColumnOption) Column[T]
func NewBoolColumn ¶ added in v0.32.0
func NewBoolColumn(name string, options ...ColumnOption) Column[bool]
func NewColumn ¶
func NewColumn[T any](name string, defaultValue T, options ...ColumnOption) Column[any]
func NewTypedColumn ¶ added in v0.35.0
func NewTypedColumn[T any](name string, defaultValue T, options ...ColumnOption) Column[T]
type ColumnAccessor ¶
type ColumnOption ¶ added in v0.35.0
type ColumnOption = func(o *ColumnOptions)
type ColumnOptions ¶ added in v0.35.0
type ColumnOptions struct {
// contains filtered or unexported fields
}
type ColumnarRecordset ¶
type ColumnarRecordset struct {
// contains filtered or unexported fields
}
func NewColumnarRecordset ¶
func NewColumnarRecordset(name string, cols ...Column[any]) *ColumnarRecordset
func (*ColumnarRecordset) ColumnsCount ¶
func (c *ColumnarRecordset) ColumnsCount() int
func (*ColumnarRecordset) GetColumnByIndex ¶
func (*ColumnarRecordset) GetColumnByName ¶
func (*ColumnarRecordset) GetColumnIndex ¶
func (*ColumnarRecordset) GetRow ¶
func (rs *ColumnarRecordset) GetRow(i int) Row
func (*ColumnarRecordset) Name ¶
func (rs *ColumnarRecordset) Name() string
func (*ColumnarRecordset) NewRow ¶
func (rs *ColumnarRecordset) NewRow() Row
func (*ColumnarRecordset) RowsCount ¶
func (rs *ColumnarRecordset) RowsCount() int
type Options ¶ added in v0.39.1
type Options interface {
Name() string
}
func NewOptions ¶ added in v0.39.1
type Recordset ¶
type Recordset interface {
ColumnAccessor
Name() string // Can be useful for debugging purpose (or for joining?)
NewRow() Row
// GetRow returns nil if out of range
GetRow(i int) Row
RowsCount() int
}
Recordset provides interface for working with a set of row/column based data
type Row ¶
type Row interface {
GetValueByName(name string, rs Recordset) (any, error)
SetValueByName(name string, value any, rs Recordset) error
GetValueByIndex(i int, rs Recordset) (any, error)
SetValueByIndex(i int, value any, rs Recordset) error
Data(rs Recordset) (data []any, err error)
}
Row defines an interface for storing recordset row data. We intentionally pass cols information to functions of the interface so we do not need to allocate memory for cols pointer in each row.
type UntypedColWrapper ¶ added in v0.35.0
type UntypedColWrapper[T any] struct { // contains filtered or unexported fields }
func (UntypedColWrapper[T]) Add ¶ added in v0.35.0
func (c UntypedColWrapper[T]) Add(value any) error
func (UntypedColWrapper[T]) DbType ¶ added in v0.39.0
func (c UntypedColWrapper[T]) DbType() string
func (UntypedColWrapper[T]) DefaultValue ¶ added in v0.35.0
func (c UntypedColWrapper[T]) DefaultValue() (value any)
func (UntypedColWrapper[T]) GetValue ¶ added in v0.35.0
func (c UntypedColWrapper[T]) GetValue(row int) (value any, err error)
func (UntypedColWrapper[T]) IsBitmap ¶ added in v0.35.0
func (c UntypedColWrapper[T]) IsBitmap() bool
func (UntypedColWrapper[T]) Name ¶ added in v0.35.0
func (c UntypedColWrapper[T]) Name() string
func (UntypedColWrapper[T]) SetValue ¶ added in v0.35.0
func (c UntypedColWrapper[T]) SetValue(row int, value any) (err error)
func (UntypedColWrapper[T]) TypedColumn ¶ added in v0.35.0
func (c UntypedColWrapper[T]) TypedColumn() Column[T]
func (UntypedColWrapper[T]) ValueType ¶ added in v0.35.0
func (c UntypedColWrapper[T]) ValueType() reflect.Type
func (UntypedColWrapper[T]) Values ¶ added in v0.35.0
func (c UntypedColWrapper[T]) Values() []any
Click to show internal directories.
Click to hide internal directories.