Documentation
¶
Index ¶
- func ZSetToTable(z zset.ZSet, t *Table) error
- type Column
- type ColumnType
- type Database
- func (d *Database) Delete(table string, pk string) (bool, error)
- func (d *Database) DropTable(name string) error
- func (d *Database) GetName() string
- func (d *Database) GetTable(name string) (*Table, error)
- func (d *Database) Insert(table string, data []any) error
- func (d *Database) MarshalJSON() ([]byte, error)
- func (d *Database) RegisterTable(name string, table *Table)
- func (d *Database) Tables() []string
- func (d *Database) UnmarshalJSON(data []byte) error
- func (d *Database) Update(table string, pk string, fn func(row *Row) error) (*Row, error)
- type Row
- func (r *Row) Copy() datamodel.Document
- func (r *Row) Fields() map[string]any
- func (r *Row) GetField(field string) (any, error)
- func (r *Row) Hash() string
- func (r *Row) MarshalJSON() ([]byte, error)
- func (r *Row) Merge(other datamodel.Document) datamodel.Document
- func (r *Row) New() datamodel.Document
- func (r *Row) PrimaryKey() (string, error)
- func (r *Row) SetField(field string, value any) error
- func (r *Row) String() string
- func (r *Row) UnmarshalJSON(data []byte) error
- type Schema
- type Table
- func (t *Table) Claim(row *Row) (*Row, error)
- func (t *Table) Delete(pk string) bool
- func (t *Table) Insert(data []any) error
- func (t *Table) InsertRow(row *Row) error
- func (t *Table) Lookup(pk string) (*Row, bool)
- func (t *Table) MarshalJSON() ([]byte, error)
- func (t *Table) ToZSet() zset.ZSet
- func (t *Table) UnmarshalJSON(data []byte) error
- func (t *Table) Update(pk string, fn func(row *Row) error) (*Row, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Column ¶
type Column struct {
Name string
QualifiedName string
Type ColumnType
}
type ColumnType ¶
type ColumnType int
const ( TypeAny ColumnType = iota TypeInt TypeString TypeFloat )
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
Database holds table schemas for query compilation.
func (*Database) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
func (*Database) RegisterTable ¶
RegisterTable adds a table schema to the catalog.
func (*Database) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
type Row ¶
Row implements Document. It uses orderedcode for keys and a slice for data.
func ConcatRows ¶
ConcatRows combines two rows into a joined row with qualified columns.
func (*Row) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
func (*Row) PrimaryKey ¶
func (*Row) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
type Schema ¶
type Schema struct {
Columns []Column
PKIndices []int // Indices of columns that make up the Primary Key
Aliases map[string]string
}
Schema defines the table schemata
func (*Schema) WithPrimaryKey ¶
WithPrimaryKey sets primary key column indices.
func (*Schema) WithQualifiedNames ¶
WithQualifiedNames fills QualifiedName as table.column when missing.
type Table ¶
func (*Table) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
func (*Table) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
Click to show internal directories.
Click to hide internal directories.