simpledb

package module
v0.0.0-...-eb9632d Latest Latest
Warning

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

Go to latest
Published: May 13, 2016 License: MIT Imports: 5 Imported by: 0

README

simple-datastore

Simple datastore in go. Relational data base with schema and relationships

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Must

func Must(err error)

Types

type Datastore

type Datastore struct {
	File string
	// contains filtered or unexported fields
}

func Open

func Open(file string) *Datastore

func (*Datastore) DefineTable

func (db *Datastore) DefineTable(name string, schema Schema) (*Table, error)

Create new table in datastore

func (*Datastore) Dump

func (db *Datastore) Dump() error

Write data from tables to database file

func (*Datastore) GetTable

func (db *Datastore) GetTable(name string) *Table

func (*Datastore) MustDump

func (db *Datastore) MustDump()

func (*Datastore) Tables

func (db *Datastore) Tables() []Table

Get value of all tables in database

type Field

type Field string

func (Field) Parse

func (f Field) Parse(v interface{}) interface{}

type Node

type Node map[string]interface{}

func Nodify

func Nodify(s interface{}) Node

func (Node) Parse

func (n Node) Parse(out interface{})

type Schema

type Schema map[string]Field

func Schemafy

func Schemafy(s interface{}) Schema

type Table

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

func (*Table) Insert

func (t *Table) Insert(n Node) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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