mellivora

package module
v0.0.0-...-9f9d3c3 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

README

Mellivora (Honey Badger)

Build Status

Mellivora is a relational struct based database that is distributed via raft and built on top of BadgerDB.

Some documentation on the underlying design can be found here: Documentation

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
}

func NewDatabase

func NewDatabase(store *meles.Store, logger timber.Logger) *Database

func (*Database) Begin

func (db *Database) Begin() (*Transaction, error)

type Ex

type Ex map[string]interface{}

type Field

type Field interface {
	FieldId() uint32
	Name() string
	IsPrimaryKey() bool
	Reflection() reflect.StructField
}

type FieldSet

type FieldSet interface {
	GetAll() []Field
	GetById(fieldId uint32) Field
	GetByName(fieldName string) Field
}

type Model

type Model interface {
	ModelId() uint32
	Name() string
	Type() reflect.Type
	Fields() FieldSet
	PrimaryKey() FieldSet
	UniqueConstraints() UniqueConstraintSet
	Relations()
}

type Query

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

func (*Query) AndWhere

func (q *Query) AndWhere(expression ...Ex) *Query

func (*Query) InnerJoin

func (q *Query) InnerJoin(relatedModel interface{}) *Query

func (*Query) LeftJoin

func (q *Query) LeftJoin(relatedModel interface{}) *Query

func (*Query) Limit

func (q *Query) Limit(limit int) *Query

func (*Query) Select

func (q *Query) Select(destination interface{}) error

func (*Query) Where

func (q *Query) Where(expression ...Ex) *Query

type Relation

type Relation interface {
	RelationId() uint32
	Name() string
	LocalField() Field
	RemoteField() Field
	RemoteModel() Model
}

type StorageEngine

type StorageEngine interface {
	Begin() (*Transaction, error)
}

type Transaction

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

func (*Transaction) Commit

func (txn *Transaction) Commit() error

func (*Transaction) Insert

func (txn *Transaction) Insert(model interface{}) error

func (*Transaction) Model

func (txn *Transaction) Model(model interface{}) *Query

func (*Transaction) Rollback

func (txn *Transaction) Rollback() error

type TransactionEngine

type TransactionEngine interface {
}

type UniqueConstraint

type UniqueConstraint interface {
	UniqueConstraintId() uint32
	Name() string
	Fields() FieldSet
}

type UniqueConstraintSet

type UniqueConstraintSet interface {
	GetAll() []UniqueConstraint
	GetById(uniqueConstraintId uint32) UniqueConstraint
	GetByName(uniqueConstraintName string) UniqueConstraint
}

Jump to

Keyboard shortcuts

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