storage

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2021 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Column

type Column struct {
	Name string
	Type value.Type
}

type DB

type DB struct {
	Name   string
	Path   string
	Tables map[string]Table
}

type DBInfo

type DBInfo struct {
	Schema string
	DB     string
}

type Engine

type Engine interface {
	GetEngineName() string
	GetDatabase() map[string]DB
	GetTableValues(db, table string) ([]map[string]value.Value, error)
	GetValue(db, table, column string, line int) (value.Value, error)
	GetColumns(db, table string) []string
	WriteTable(db, table string, values []map[string]value.Value) error
}

type Storage

type Storage struct {
	Engine map[string]*Engine
}

func GetInstance

func GetInstance() *Storage

func (*Storage) Add

func (s *Storage) Add(schema string, engine Engine)

func (*Storage) GetDBInfoFromDB

func (s *Storage) GetDBInfoFromDB(db string) []DBInfo

func (*Storage) GetDBInfoFromTable

func (s *Storage) GetDBInfoFromTable(table string) []TableInfo

func (*Storage) GetEngine

func (s *Storage) GetEngine(schema string) *Engine

type Table

type Table struct {
	Name    string
	Path    string
	Columns []Column
}

type TableInfo

type TableInfo struct {
	Schema string
	DB     string
	Table  string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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