file

package
v0.0.0-...-30e45d9 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2017 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

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

DB is yaml implementation of DB This db backend is intended for development and test purpose only

func NewDB

func NewDB() *DB

NewDB constructor

func (*DB) Begin

func (db *DB) Begin() (transaction.Transaction, error)

Begin connection starts new transaction

func (*DB) Close

func (db *DB) Close()

func (*DB) Connect

func (db *DB) Connect(format, conn string, maxOpenConn int) error

Connect connec to the db

func (*DB) DropTable

func (db *DB) DropTable(s *schema.Schema) error

DropTable drop table definition

func (*DB) RegisterTable

func (db *DB) RegisterTable(s *schema.Schema, cascade bool) error

RegisterTable register table definition

type Transaction

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

Transaction is yaml implementation of DB This db backend is intended for development and test purpose only

func (*Transaction) Close

func (tx *Transaction) Close() error

Close connection

func (*Transaction) Closed

func (tx *Transaction) Closed() bool

Closed is unsupported in this db

func (*Transaction) Commit

func (tx *Transaction) Commit() error

Commit commits changes to db Unsupported in this db

func (*Transaction) Create

func (tx *Transaction) Create(resource *schema.Resource) error

Create create resource in the db

func (*Transaction) Delete

func (tx *Transaction) Delete(s *schema.Schema, resourceID interface{}) error

Delete delete resource from db

func (*Transaction) Exec

func (tx *Transaction) Exec(sql string, args ...interface{}) error

Exec executes sql in transaction

func (*Transaction) Fetch

func (tx *Transaction) Fetch(s *schema.Schema, filter transaction.Filter) (*schema.Resource, error)

Fetch resources by ID in the db

func (*Transaction) List

func (tx *Transaction) List(s *schema.Schema, filter transaction.Filter, pg *pagination.Paginator) (list []*schema.Resource, total uint64, err error)

List resources in the db

func (*Transaction) Query

func (tx *Transaction) Query(s *schema.Schema, query string, arguments []interface{}) (list []*schema.Resource, err error)

Query with raw string

func (*Transaction) RawTransaction

func (tx *Transaction) RawTransaction() *sqlx.Tx

RawTransaction returns raw transaction

func (*Transaction) SetIsolationLevel

func (tx *Transaction) SetIsolationLevel(level transaction.Type) error

SetIsolationLevel specify transaction isolation level

func (*Transaction) StateFetch

func (tx *Transaction) StateFetch(s *schema.Schema, filter transaction.Filter) (state transaction.ResourceState, err error)

StateFetch is not supported in file databases

func (*Transaction) StateUpdate

func (tx *Transaction) StateUpdate(resource *schema.Resource, _ *transaction.ResourceState) error

StateUpdate update resource state

func (*Transaction) Update

func (tx *Transaction) Update(resource *schema.Resource) error

Update update resource in the db

Jump to

Keyboard shortcuts

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