memdb

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Memdb package implements a Qlbridge Datasource in-memory implemenation using the hashicorp go-memdb (immuteable radix tree's). Qlbridge Exec allows key-value datasources to have full SQL functionality.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MemDb

type MemDb struct {
	*schema.Schema // schema
	// contains filtered or unexported fields
}

MemDb implements qlbridge `Source` to allow in-memory native go data to have a Schema and implement and be operated on by Sql Statements.

func NewMemDb

func NewMemDb(name string, cols []string) (*MemDb, error)

NewMemDb creates a MemDb with given indexes, columns

func NewMemDbData

func NewMemDbData(name string, data [][]driver.Value, cols []string) (*MemDb, error)

NewMemDbData creates a MemDb with given indexes, columns, and values

func NewMemDbForSchema

func NewMemDbForSchema(name string, cols []string) (*MemDb, error)

NewMemDbForSchema creates a MemDb with given indexes, columns

func (*MemDb) Close

func (m *MemDb) Close() error

Close this source

func (*MemDb) Init

func (m *MemDb) Init()

Init initilize this db

func (*MemDb) Open

func (m *MemDb) Open(table string) (schema.Conn, error)

Open a Conn for this source @table name

func (*MemDb) Setup

func (m *MemDb) Setup(*schema.Schema) error

Setup this db with parent schema.

func (*MemDb) Table

func (m *MemDb) Table(table string) (*schema.Table, error)

Table by name

func (*MemDb) Tables

func (m *MemDb) Tables() []string

Tables list, should be single table

Jump to

Keyboard shortcuts

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