dao

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: May 4, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MetaTableName = "meta"
)

constant metatable name reference

Variables

This section is empty.

Functions

func DeleteMetaByKey

func DeleteMetaByKey(key string) error

DeleteMetaByKey delete meta by key

func InsertOrUpdate

func InsertOrUpdate(meta *Meta) error

InsertOrUpdate insert or update meta

func IsNonUniqueNameError added in v1.6.1

func IsNonUniqueNameError(err error) bool

IsNonUniqueNameError tests if the error returned by sqlite is unique. It will check various sqlite versions.

func QueryAllMeta

func QueryAllMeta(key string, condition string) (*[]Meta, error)

QueryAllMeta return all meta, if no error, Meta not null

func QueryMeta

func QueryMeta(key string, condition string) (*[]string, error)

QueryMeta return only meta's value, if no error, Meta not null

func SaveMeta

func SaveMeta(meta *Meta) error

SaveMeta save meta to db

func UpdateMeta

func UpdateMeta(meta *Meta) error

UpdateMeta update meta

func UpdateMetaField

func UpdateMetaField(key string, col string, value interface{}) error

UpdateMetaField update special field

func UpdateMetaFields

func UpdateMetaFields(key string, cols map[string]interface{}) error

UpdateMetaFields update special fields

Types

type Meta

type Meta struct {
	Key   string `orm:"column(key); size(256); pk"`
	Type  string `orm:"column(type); size(32)"`
	Value string `orm:"column(value); null; type(text)"`
}

Meta metadata object

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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