Documentation ¶
Index ¶
- Variables
- type ColNameIndexes
- type ColumnID
- type DB
- type DBRow
- type DBRows
- type DBTable
- func (t *DBTable) Copy() Table
- func (t *DBTable) CrossJoin(rtb Table) (Table, error)
- func (t *DBTable) Delete(condFn func(Row) (core.Value, error)) (Table, error)
- func (t *DBTable) GetColNames() core.ColumnNames
- func (t *DBTable) GetCols() core.Cols
- func (t *DBTable) GetName() string
- func (t *DBTable) GetRows() []Row
- func (t *DBTable) InsertValues(names core.ColumnNames, valsList core.ValuesList) error
- func (t *DBTable) Limit(N int) (Table, error)
- func (t *DBTable) OrderBy(cols core.ColumnNames, sortDirs []int) (Table, error)
- func (t *DBTable) Project(TargetColNames core.ColumnNames, resFuncs []func(Row) (core.Value, error)) (Table, error)
- func (t *DBTable) RenameTableName(name string)
- func (t *DBTable) SetColNames(names core.ColumnNames)
- func (t *DBTable) Update(colNames core.ColumnNames, condFn func(Row) (core.Value, error), ...) (Table, error)
- func (t *DBTable) Where(condFn func(Row) (core.Value, error)) (Table, error)
- type Database
- type ErrColumnNotFound
- type Row
- type Table
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrTableAlreadyExists occures when creating table exists ErrTableAlreadyExists = errors.New("the table already exists") // ErrTableNotFound occures when creating table exists ErrTableNotFound = errors.New("there is no such table") // ErrIndexNotFound occurs when a table doesn't contain given column. ErrIndexNotFound = errors.New("there is no index corresponding column name") )
Functions ¶
This section is empty.
Types ¶
type ColNameIndexes ¶
type ColNameIndexes map[core.ColumnName]int
ColNameIndexes is map ColName to corresponding column index
func (ColNameIndexes) Copy ¶
func (c ColNameIndexes) Copy() ColNameIndexes
Copy copies ColNameIndexes
type DB ¶
type DB interface { GetTable(string) (Table, error) CreateTable(string, core.Cols) error DropTable(string) error }
DB is interface of DBMS
type DBRow ¶
type DBRow struct { ColNames core.ColumnNames Values core.Values }
DBRow is struct of row of table
func (*DBRow) GetColNames ¶
func (r *DBRow) GetColNames() core.ColumnNames
GetColNames gets column names from DBRow
func (*DBRow) GetValueByColName ¶
GetValueByColName gets value from row by ColName
func (*DBRow) UpdateValue ¶
func (r *DBRow) UpdateValue(name core.ColumnName, val core.Value)
UpdateValue updates value by specifing column name
type DBTable ¶
DBTable is struct for DBTable
func (*DBTable) GetColNames ¶
func (t *DBTable) GetColNames() core.ColumnNames
GetColNames return column names of table
func (*DBTable) InsertValues ¶
func (t *DBTable) InsertValues(names core.ColumnNames, valsList core.ValuesList) error
InsertValues inserts values into the table
func (*DBTable) Project ¶
func (t *DBTable) Project(TargetColNames core.ColumnNames, resFuncs []func(Row) (core.Value, error)) (Table, error)
Project is method to select columns of table.
func (*DBTable) RenameTableName ¶
RenameTableName updates table name
func (*DBTable) SetColNames ¶
func (t *DBTable) SetColNames(names core.ColumnNames)
SetColNames sets ColNames in Table
type Database ¶
Database is struct for Database
func (*Database) CreateTable ¶
CreateTable is method to create table
type ErrColumnNotFound ¶
type ErrColumnNotFound int
const (
ColumnNotFound ErrColumnNotFound = iota
)
type Row ¶
type Row interface { // GetValueByColName is used in ColRefNode when getting value GetValueByColName(core.ColumnName) (core.Value, error) GetValues() core.Values GetColNames() core.ColumnNames UpdateValue(core.ColumnName, core.Value) }
Row is interface of row of table.
type Table ¶
type Table interface { Copy() Table GetName() string GetColNames() core.ColumnNames GetRows() []Row GetCols() core.Cols InsertValues(core.ColumnNames, core.ValuesList) error RenameTableName(string) Project(core.ColumnNames, []func(Row) (core.Value, error)) (Table, error) Where(func(Row) (core.Value, error)) (Table, error) CrossJoin(Table) (Table, error) OrderBy(core.ColumnNames, []int) (Table, error) Limit(int) (Table, error) Update(core.ColumnNames, func(Row) (core.Value, error), []func(Row) (core.Value, error)) (Table, error) Delete(func(Row) (core.Value, error)) (Table, error) }
Table is interface of table.
Click to show internal directories.
Click to hide internal directories.