db

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2017 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const DB_INSERT = 1
View Source
const DB_UPDATE = 2

Variables

This section is empty.

Functions

func HasDeletedAt

func HasDeletedAt(model interface{}) (bool, error)

func InitializeTable

func InitializeTable(gorpdb *gorp.DbMap, model interface{}, table string) error

func InitializeTableAdv

func InitializeTableAdv(gorpdb *gorp.DbMap, model interface{}, table string, primary_field string) error

func ModelCreatedAt

func ModelCreatedAt(model interface{}) (int, error)

func ModelDeletedAt

func ModelDeletedAt(model interface{}) (int, error)

func ModelMarkCreate

func ModelMarkCreate(model interface{}) error

func ModelMarkDelete

func ModelMarkDelete(model interface{}) error

func ModelMarkUpdate

func ModelMarkUpdate(model interface{}) error

func ModelUpdatedAt

func ModelUpdatedAt(model interface{}) (int, error)

func PrimaryField

func PrimaryField(model map[string]interface{}) (string, int, error)

func SqlxInsert

func SqlxInsert(model map[string]interface{}, table string, db_type string) (string, []interface{}, error)

return sql, params array, error

func SqlxUpdate

func SqlxUpdate(model map[string]interface{}, table string, db_type string) (string, []interface{}, error)

return sql, params array, error

func UpdateOrInsert

func UpdateOrInsert(model map[string]interface{}) (int, error)

1 = insert, 2 = update

Types

type ModelDeletable

type ModelDeletable interface {
	MarkedDeleted(time.Time)
}

type ModelInfo

type ModelInfo struct {
	Dates  map[string]int
	Fields []string
}

Jump to

Keyboard shortcuts

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