orm

package module
v0.0.0-...-eb0ad0d Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2020 License: MIT Imports: 9 Imported by: 0

README

orm

A wrapper of gorm

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Instantiate

func Instantiate(dsn string, enableLog bool)

func IsRecordNotFound

func IsRecordNotFound(err error) bool

Types

type DB

type DB struct {
	*gorm.DB
}
var Singleton *DB

func (*DB) Begin

func (db *DB) Begin() *TX

func (*DB) BulkCreate

func (db *DB) BulkCreate(objects interface{}, opts ...bulk_insert.BuilderOpt) error

type IDModel

type IDModel struct {
	ID string `gorm:"primary_key;size:20"`
}

type Model

type Model struct {
	ID        string    `gorm:"primary_key;size:20"`
	CreatedAt time.Time `gorm:"index"`
	UpdatedAt time.Time `gorm:"index"`
}

type TX

type TX struct {
	*gorm.DB
	// contains filtered or unexported fields
}

func (*TX) BulkCreate

func (tx *TX) BulkCreate(objects interface{}, opts ...bulk_insert.BuilderOpt) error

func (*TX) Commit

func (tx *TX) Commit(noPanic ...bool) error

func (*TX) End

func (tx *TX) End()

type TimeModel

type TimeModel struct {
	CreatedAt time.Time `gorm:"index"`
	UpdatedAt time.Time `gorm:"index"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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