memory

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 19, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

type Database struct {
	// contains filtered or unexported fields
}

Database is an in-memory database.

func NewDatabase

func NewDatabase(name string) *Database

NewDatabase creates a new database with the given name.

func (*Database) AddTable

func (d *Database) AddTable(name string, t sql.Table)

AddTable adds a new table to the database.

func (*Database) Create

func (d *Database) Create(name string, schema sql.Schema) error

Create creates a table with the given name and schema

func (*Database) Name

func (d *Database) Name() string

Name returns the database name.

func (*Database) Tables

func (d *Database) Tables() map[string]sql.Table

Tables returns all tables in the database.

type Table

type Table struct {
	// contains filtered or unexported fields
}

Table represents an in-memory database table.

func NewPartitionedTable

func NewPartitionedTable(name string, schema sql.Schema, numPartitions int) *Table

NewPartitionedTable creates a new Table with the given name, schema and number of partitions.

func NewTable

func NewTable(name string, schema sql.Schema) *Table

NewTable creates a new Table with the given name and schema.

func (*Table) Delete

func (t *Table) Delete(ctx *sql.Context, row sql.Row) error

Delete the given row from the table.

func (*Table) Filters

func (t *Table) Filters() []sql.Expression

Filters implements the sql.FilteredTable interface.

func (*Table) HandledFilters

func (t *Table) HandledFilters(filters []sql.Expression) []sql.Expression

HandledFilters implements the sql.FilteredTable interface.

func (*Table) IndexKeyValues

func (t *Table) IndexKeyValues(
	ctx *sql.Context,
	colNames []string,
) (sql.PartitionIndexKeyValueIter, error)

IndexKeyValues implements the sql.IndexableTable interface.

func (*Table) IndexLookup

func (t *Table) IndexLookup() sql.IndexLookup

IndexLookup implements the sql.IndexableTable interface.

func (*Table) Insert

func (t *Table) Insert(ctx *sql.Context, row sql.Row) error

Insert a new row into the table.

func (*Table) Name

func (t *Table) Name() string

Name implements the sql.Table interface.

func (*Table) PartitionCount

func (t *Table) PartitionCount(ctx *sql.Context) (int64, error)

PartitionCount implements the sql.PartitionCounter interface.

func (*Table) PartitionRows

func (t *Table) PartitionRows(ctx *sql.Context, partition sql.Partition) (sql.RowIter, error)

PartitionRows implements the sql.PartitionRows interface.

func (*Table) Partitions

func (t *Table) Partitions(ctx *sql.Context) (sql.PartitionIter, error)

Partitions implements the sql.Table interface.

func (*Table) Projection

func (t *Table) Projection() []string

Projection implements the sql.ProjectedTable interface.

func (*Table) Schema

func (t *Table) Schema() sql.Schema

Schema implements the sql.Table interface.

func (*Table) String

func (t *Table) String() string

String implements the sql.Table inteface.

func (*Table) WithFilters

func (t *Table) WithFilters(filters []sql.Expression) sql.Table

WithFilters implements the sql.FilteredTable interface.

func (*Table) WithIndexLookup

func (t *Table) WithIndexLookup(lookup sql.IndexLookup) sql.Table

WithIndexLookup implements the sql.IndexableTable interface.

func (*Table) WithProjection

func (t *Table) WithProjection(colNames []string) sql.Table

WithProjection implements the sql.ProjectedTable interface.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL