Documentation
¶
Index ¶
- type By
- type Column
- type DataTable
- func Concat(tables []*DataTable) (*DataTable, error)
- func InnerJoin(tables []*DataTable, on []JoinOn) (*DataTable, error)
- func LeftJoin(tables []*DataTable, on []JoinOn) (*DataTable, error)
- func New(name string) *DataTable
- func OuterJoin(tables []*DataTable, on []JoinOn) (*DataTable, error)
- func RightJoin(tables []*DataTable, on []JoinOn) (*DataTable, error)
- func (t *DataTable) AddBoolColumn(name string, v ...interface{}) error
- func (t *DataTable) AddBoolExprColumn(name string, expr string) error
- func (t *DataTable) AddColumn(name string, sr serie.Serie) error
- func (t *DataTable) AddExprColumn(name string, sr serie.Serie, formulae string) error
- func (t *DataTable) AddFloat32Column(name string, v ...interface{}) error
- func (t *DataTable) AddFloat32ExprColumn(name string, expr string) error
- func (t *DataTable) AddFloat64Column(name string, v ...interface{}) error
- func (t *DataTable) AddFloat64ExprColumn(name string, expr string) error
- func (t *DataTable) AddInt32Column(name string, v ...interface{}) error
- func (t *DataTable) AddInt32ExprColumn(name string, expr string) error
- func (t *DataTable) AddInt64Column(name string, v ...interface{}) error
- func (t *DataTable) AddInt64ExprColumn(name string, expr string) error
- func (t *DataTable) AddIntColumn(name string, v ...interface{}) error
- func (t *DataTable) AddIntExprColumn(name string, expr string) error
- func (t *DataTable) AddStringColumn(name string, v ...interface{}) error
- func (t *DataTable) AddStringExprColumn(name string, expr string) error
- func (t *DataTable) AddTimeColumn(name string, v ...interface{}) error
- func (t *DataTable) AddTimeExprColumn(name string, expr string) error
- func (t *DataTable) Append(row ...Row)
- func (t *DataTable) AppendRow(v ...interface{}) error
- func (t *DataTable) Column(name string) Column
- func (t *DataTable) ColumnIndex(name string) int
- func (t *DataTable) Columns() []string
- func (left *DataTable) Concat(table ...*DataTable) (*DataTable, error)
- func (t *DataTable) Copy() *DataTable
- func (t *DataTable) EmptyCopy() *DataTable
- func (t *DataTable) Grow(size int)
- func (t *DataTable) Head(size int) *DataTable
- func (t *DataTable) HiddenColumns() []string
- func (t *DataTable) HideColumn(name string)
- func (left *DataTable) InnerJoin(right *DataTable, on []JoinOn) (*DataTable, error)
- func (left *DataTable) LeftJoin(right *DataTable, on []JoinOn) (*DataTable, error)
- func (t *DataTable) Name() string
- func (t *DataTable) NewRow() Row
- func (t *DataTable) NumCols() int
- func (t *DataTable) NumRows() int
- func (left *DataTable) OuterJoin(right *DataTable, on []JoinOn) (*DataTable, error)
- func (t *DataTable) Print(writer io.Writer, opt ...PrintOption)
- func (t *DataTable) Records() [][]string
- func (t *DataTable) Rename(name string)
- func (t *DataTable) RenameColumn(old, name string) error
- func (left *DataTable) RightJoin(right *DataTable, on []JoinOn) (*DataTable, error)
- func (t *DataTable) Row(at int) Row
- func (t *DataTable) Rows() []Row
- func (t *DataTable) ShowColumn(name string)
- func (t *DataTable) Sort(by ...By) *DataTable
- func (t *DataTable) String() string
- func (t *DataTable) Subset(at, size int) *DataTable
- func (t *DataTable) SwapColumn(a, b string) error
- func (t *DataTable) SwapRow(i, j int)
- func (t *DataTable) Tail(size int) *DataTable
- func (t *DataTable) ToMap() []map[string]interface{}
- func (t *DataTable) ToSchema() *Schema
- func (t *DataTable) ToTable() [][]interface{}
- func (t *DataTable) Update(at int, row Row) error
- type JoinOn
- type PrintOption
- type PrintOptions
- type Row
- type Schema
- type SchemaColumn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DataTable ¶
type DataTable struct {
// contains filtered or unexported fields
}
DataTable is our main struct
func InnerJoin ¶
InnerJoin selects records that have matching values in both tables. tables[0] is used as reference datatable.
func (*DataTable) AddBoolColumn ¶
AddBoolColumn to add a column of nullable bool
func (*DataTable) AddBoolExprColumn ¶
AddBoolExprColumn to add a calculated column of nullable bool
func (*DataTable) AddExprColumn ¶
AddExprColumn to add a calculated column with a serie of T
func (*DataTable) AddFloat32Column ¶
AddFloat32Column to add a column of nullable float32
func (*DataTable) AddFloat32ExprColumn ¶
AddFloat32ExprColumn to add a calculated column of nullable bool
func (*DataTable) AddFloat64Column ¶
AddFloat64Column to add a column of nullable float64
func (*DataTable) AddFloat64ExprColumn ¶
AddFloat64ExprColumn to add a calculated column of nullable bool
func (*DataTable) AddInt32Column ¶
AddInt32Column to add a column of nullable int32
func (*DataTable) AddInt32ExprColumn ¶
AddInt32ExprColumn to add a calculated column of nullable int32
func (*DataTable) AddInt64Column ¶
AddInt64Column to add a column of nullable int64
func (*DataTable) AddInt64ExprColumn ¶
AddInt64ExprColumn to add a calculated column of nullable int32
func (*DataTable) AddIntColumn ¶
AddIntColumn to add a column of nullable int
func (*DataTable) AddIntExprColumn ¶
AddIntExprColumn to add a calculated column of nullable int
func (*DataTable) AddStringColumn ¶
AddStringColumn to add a column of nullable string
func (*DataTable) AddStringExprColumn ¶
AddStringExprColumn to add a calculated column of nullable bool
func (*DataTable) AddTimeColumn ¶
AddTimeColumn to add a column of nullable time
func (*DataTable) AddTimeExprColumn ¶
AddTimeExprColumn to add a calculated column of nullable bool
func (*DataTable) ColumnIndex ¶
ColumnIndex gets the index of the column with name returns -1 if not found
func (*DataTable) HiddenColumns ¶
HiddenColumns returns the hidden column names in datatable
func (*DataTable) HideColumn ¶
HideColumn hides a column a hidden column will not be exported
func (*DataTable) InnerJoin ¶
InnerJoin selects records that have matching values in both tables. left datatable is used as reference datatable. <!> InnerJoin transforms an expr column to a raw column
func (*DataTable) LeftJoin ¶
LeftJoin returns all records from the left table (table1), and the matched records from the right table (table2). The result is NULL from the right side, if there is no match. <!> LeftJoin transforms an expr column to a raw column
func (*DataTable) OuterJoin ¶
OuterJoin returns all records when there is a match in either left or right table <!> OuterJoin transforms an expr column to a raw column
func (*DataTable) Print ¶
func (t *DataTable) Print(writer io.Writer, opt ...PrintOption)
Print the tables with options
func (*DataTable) Records ¶
Records returns the rows in datatable as string Computes all expressions.
func (*DataTable) RenameColumn ¶
RenameColumn to rename a column
func (*DataTable) RightJoin ¶
RightJoin returns all records from the right table (table2), and the matched records from the left table (table1). The result is NULL from the left side, when there is no match. <!> RightJoin transforms an expr column to a raw column
func (*DataTable) ShowColumn ¶
ShowColumn shows a column a shown column will be exported
func (*DataTable) SwapColumn ¶
SwapColumn to swap 2 columns
type JoinOn ¶
type PrintOption ¶
type PrintOption func(opts *PrintOptions)
func PrintColumnName ¶
func PrintColumnName(v bool) PrintOption
func PrintColumnType ¶
func PrintColumnType(v bool) PrintOption
func PrintMaxRows ¶
func PrintMaxRows(v int) PrintOption
func PrintRowNumber ¶
func PrintRowNumber(v bool) PrintOption
type PrintOptions ¶
PrintOptions to control the printer
type Row ¶
type Row map[string]interface{}
Row contains a row relative to columns
type Schema ¶
type Schema struct {
Name string `json:"name"`
Columns []SchemaColumn `json:"cols"`
Rows [][]interface{} `json:"rows"`
}
Schema describes a datatable

