db

package
v0.0.15 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	And = clause.And
	Not = clause.Not
	Or  = clause.Or

	Assignments       = clause.Assignments
	AssignmentColumns = clause.AssignmentColumns
)
View Source
var ErrRecordNotFound = gorm.ErrRecordNotFound

Functions

func IsErrNoRows

func IsErrNoRows(err error) bool

func SetDefaultDB

func SetDefaultDB(x *Client)

func SetIDGenerator

func SetIDGenerator(f idGeneratorFunc)

Types

type AndConditions

type AndConditions = clause.AndConditions

type Assignment

type Assignment = clause.Assignment

type Clause

type Clause = clause.Clause

type Client added in v0.0.5

type Client struct {
	*gorm.DB
}

func Default

func Default() *Client

func New

func New(typ, dsn string, def ...bool) (*Client, error)

type Column

type Column = clause.Column

type CommaExpression

type CommaExpression = clause.CommaExpression

type Delete

type Delete = clause.Delete

type Eq

type Eq = clause.Eq

type Expr

type Expr = clause.Expr

type From

type From = clause.From

type GroupBy

type GroupBy = clause.GroupBy

type Gt

type Gt = clause.Gt

type Gte

type Gte = clause.Gte

type IN

type IN = clause.IN

type Insert

type Insert = clause.Insert

type Join

type Join = clause.Join

type JoinType

type JoinType = clause.JoinType

type Like

type Like = clause.Like

type Limit

type Limit = clause.Limit

type Locking

type Locking = clause.Locking

type Lt

type Lt = clause.Lt

type Lte

type Lte = clause.Lte

type Meta

type Meta struct {
	ID        string         `gorm:"primaryKey;size:36"`
	CreatedAt time.Time      `gorm:"autoCreateTime"`
	CreatedBy string         `gorm:"size:36;index"`
	UpdatedAt time.Time      `gorm:"autoUpdateTime"`
	UpdatedBy string         `gorm:"size:36;index"`
	DeletedAt gorm.DeletedAt `gorm:"index"`
}

func (*Meta) BeforeCreate

func (meta *Meta) BeforeCreate(tx *gorm.DB) error

func (*Meta) BeforeDelete

func (meta *Meta) BeforeDelete(tx *gorm.DB) error

func (*Meta) BeforeSave

func (meta *Meta) BeforeSave(tx *gorm.DB) error

func (*Meta) BeforeUpdate

func (meta *Meta) BeforeUpdate(tx *gorm.DB) error

type MetaD

type MetaD struct {
	ID        string         `gorm:"primaryKey;size:36"`
	CreatedAt time.Time      `gorm:"autoCreateTime"`
	CreatedBy string         `gorm:"size:36;index"`
	UpdatedAt time.Time      `gorm:"autoUpdateTime"`
	UpdatedBy string         `gorm:"size:36;index"`
	DeletedAt gorm.DeletedAt `gorm:"index;uniqueIndex:uk_deleted_at"`
}

func (*MetaD) BeforeCreate

func (meta *MetaD) BeforeCreate(tx *gorm.DB) error

func (*MetaD) BeforeDelete

func (meta *MetaD) BeforeDelete(tx *gorm.DB) error

func (*MetaD) BeforeSave

func (meta *MetaD) BeforeSave(tx *gorm.DB) error

func (*MetaD) BeforeUpdate

func (meta *MetaD) BeforeUpdate(tx *gorm.DB) error

type NamedExpr

type NamedExpr = clause.NamedExpr

type Neq

type Neq = clause.Neq

type NotConditions

type NotConditions = clause.NotConditions

type OnConflict

type OnConflict = clause.OnConflict

type OrConditions

type OrConditions = clause.OrConditions

type OrderBy

type OrderBy = clause.OrderBy

type OrderByColumn

type OrderByColumn = clause.OrderByColumn

type Returning

type Returning = clause.Returning

type Select

type Select = clause.Select

type Set

type Set = clause.Set

type Table

type Table = clause.Table

type Update

type Update = clause.Update

type Values

type Values = clause.Values

type Where

type Where = clause.Where

type With

type With = clause.With

Jump to

Keyboard shortcuts

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