db

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2018 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 Context

type Context struct {
	Engine   *qb.Engine
	MetaData *qb.MetaDataElem
}

Context is the db context representation

func New

func New(driver string, dsn string) (*Context, error)

New returns a db context given driver & dsn

func (*Context) CreateAll

func (c *Context) CreateAll() error

CreateAll creates all tables registered to metadata

func (*Context) DropAll

func (c *Context) DropAll() error

DropAll drops all tables registered to metadata

func (*Context) Migrate

func (c *Context) Migrate(reset bool) error

Migrate drops & add tables registered to metadata given reset option

func (*Context) RegisterTable

func (c *Context) RegisterTable(table qb.TableElem)

RegisterTable registers table to metadata

Jump to

Keyboard shortcuts

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