xbgorm

package
v0.0.0-...-bc7acb5 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrRecordNotFound = gorm.ErrRecordNotFound

Functions

func IsErrRecordNotFound

func IsErrRecordNotFound(err error) bool

Types

type Association

type Association = gorm.Association

type Client

type Client = gorm.DB

type ClientBatcher

type ClientBatcher = func(client *Client, size int) error

type ClientModifier

type ClientModifier = func(client *Client) *Client

type ClientOperator

type ClientOperator = func(args ...any) error

type Config

type Config = gorm.Config

type DeleteAt

type DeleteAt = gorm.DeletedAt

type Dialector

type Dialector = gorm.Dialector

type Expression

type Expression = clause.Expression

type Model

type Model = gorm.Model

type ModelDAO

type ModelDAO[T any] struct {
	// contains filtered or unexported fields
}

func (*ModelDAO[T]) Assign

func (dao *ModelDAO[T]) Assign(dataset ...any) *ModelDAO[T]

func (*ModelDAO[T]) Association

func (dao *ModelDAO[T]) Association(field string) *Association

func (*ModelDAO[T]) Attrs

func (dao *ModelDAO[T]) Attrs(dataset ...any) *ModelDAO[T]

func (*ModelDAO[T]) Clauses

func (dao *ModelDAO[T]) Clauses(expressions ...Expression) *ModelDAO[T]

func (*ModelDAO[T]) Count

func (dao *ModelDAO[T]) Count(number *int64) *ModelDAO[T]

func (*ModelDAO[T]) Create

func (dao *ModelDAO[T]) Create(data any) *ModelDAO[T]

func (*ModelDAO[T]) CreateInBatches

func (dao *ModelDAO[T]) CreateInBatches(data any, size int) *ModelDAO[T]

func (*ModelDAO[T]) Debug

func (dao *ModelDAO[T]) Debug() *ModelDAO[T]

func (*ModelDAO[T]) Delete

func (dao *ModelDAO[T]) Delete(data any, args ...any) *ModelDAO[T]

func (*ModelDAO[T]) Distinct

func (dao *ModelDAO[T]) Distinct(args ...any) *ModelDAO[T]

func (*ModelDAO[T]) Exec

func (dao *ModelDAO[T]) Exec(sql string, args ...any) *ModelDAO[T]

func (*ModelDAO[T]) Find

func (dao *ModelDAO[T]) Find(data any, args ...any) *ModelDAO[T]

func (*ModelDAO[T]) FindInBatches

func (dao *ModelDAO[T]) FindInBatches(data any, size int, batcher ClientBatcher) *ModelDAO[T]

func (*ModelDAO[T]) First

func (dao *ModelDAO[T]) First(data any, args ...any) *ModelDAO[T]

func (*ModelDAO[T]) FirstOrCreate

func (dao *ModelDAO[T]) FirstOrCreate(data any, args ...any) *ModelDAO[T]

func (*ModelDAO[T]) FirstOrInit

func (dao *ModelDAO[T]) FirstOrInit(data any, args ...any) *ModelDAO[T]

func (*ModelDAO[T]) Get

func (dao *ModelDAO[T]) Get(key string) (any, bool)

func (*ModelDAO[T]) GetClient

func (dao *ModelDAO[T]) GetClient() *Client

func (*ModelDAO[T]) GetEntity

func (dao *ModelDAO[T]) GetEntity() *T

func (*ModelDAO[T]) GetError

func (dao *ModelDAO[T]) GetError() error

func (*ModelDAO[T]) Group

func (dao *ModelDAO[T]) Group(name string) *ModelDAO[T]

func (*ModelDAO[T]) Having

func (dao *ModelDAO[T]) Having(query any, args ...any) *ModelDAO[T]

func (*ModelDAO[T]) InnerJoins

func (dao *ModelDAO[T]) InnerJoins(query string, args ...any) *ModelDAO[T]

func (*ModelDAO[T]) InstanceGet

func (dao *ModelDAO[T]) InstanceGet(key string) (any, bool)

func (*ModelDAO[T]) InstanceSet

func (dao *ModelDAO[T]) InstanceSet(key string, value any) *ModelDAO[T]

func (*ModelDAO[T]) Joins

func (dao *ModelDAO[T]) Joins(query string, args ...any) *ModelDAO[T]

func (*ModelDAO[T]) Last

func (dao *ModelDAO[T]) Last(data any, args ...any) *ModelDAO[T]

func (*ModelDAO[T]) Limit

func (dao *ModelDAO[T]) Limit(number int) *ModelDAO[T]

func (*ModelDAO[T]) MapColumns

func (dao *ModelDAO[T]) MapColumns(mappings map[string]string) *ModelDAO[T]

func (*ModelDAO[T]) Model

func (dao *ModelDAO[T]) Model(entity *T) *ModelDAO[T]

func (*ModelDAO[T]) Not

func (dao *ModelDAO[T]) Not(query any, args ...any) *ModelDAO[T]

func (*ModelDAO[T]) Offset

func (dao *ModelDAO[T]) Offset(offset int) *ModelDAO[T]

func (*ModelDAO[T]) Omit

func (dao *ModelDAO[T]) Omit(fields ...string) *ModelDAO[T]

func (*ModelDAO[T]) Or

func (dao *ModelDAO[T]) Or(query any, args ...any) *ModelDAO[T]

func (*ModelDAO[T]) Order

func (dao *ModelDAO[T]) Order(column any) *ModelDAO[T]

func (*ModelDAO[T]) Pluck

func (dao *ModelDAO[T]) Pluck(field string, data any) *ModelDAO[T]

func (*ModelDAO[T]) Preload

func (dao *ModelDAO[T]) Preload(query string, args ...any) *ModelDAO[T]

func (*ModelDAO[T]) Raw

func (dao *ModelDAO[T]) Raw(sql string, args ...any) *ModelDAO[T]

func (*ModelDAO[T]) Row

func (dao *ModelDAO[T]) Row() *sql.Row

func (*ModelDAO[T]) Rows

func (dao *ModelDAO[T]) Rows() (*sql.Rows, error)

func (*ModelDAO[T]) Save

func (dao *ModelDAO[T]) Save(data any) *ModelDAO[T]

func (*ModelDAO[T]) Scan

func (dao *ModelDAO[T]) Scan(data any) *ModelDAO[T]

func (*ModelDAO[T]) ScanRows

func (dao *ModelDAO[T]) ScanRows(rows *sql.Rows, data any) error

func (*ModelDAO[T]) Scopes

func (dao *ModelDAO[T]) Scopes(modifiers ...ClientModifier) *ModelDAO[T]

func (*ModelDAO[T]) Select

func (dao *ModelDAO[T]) Select(query any, args ...any) *ModelDAO[T]

func (*ModelDAO[T]) Session

func (dao *ModelDAO[T]) Session(config *Session) *ModelDAO[T]

func (*ModelDAO[T]) Set

func (dao *ModelDAO[T]) Set(key string, value any) *ModelDAO[T]

func (*ModelDAO[T]) SetClient

func (dao *ModelDAO[T]) SetClient(client *Client)

func (*ModelDAO[T]) SetEntity

func (dao *ModelDAO[T]) SetEntity(entity *T)

func (*ModelDAO[T]) SetError

func (dao *ModelDAO[T]) SetError(err error)

func (*ModelDAO[T]) Table

func (dao *ModelDAO[T]) Table(name string, args ...any) *ModelDAO[T]

func (*ModelDAO[T]) Take

func (dao *ModelDAO[T]) Take(data any, args ...any) *ModelDAO[T]

func (*ModelDAO[T]) Unscoped

func (dao *ModelDAO[T]) Unscoped() *ModelDAO[T]

func (*ModelDAO[T]) Update

func (dao *ModelDAO[T]) Update(field string, value any) *ModelDAO[T]

func (*ModelDAO[T]) UpdateColumn

func (dao *ModelDAO[T]) UpdateColumn(field string, value any) *ModelDAO[T]

func (*ModelDAO[T]) UpdateColumns

func (dao *ModelDAO[T]) UpdateColumns(data any) *ModelDAO[T]

func (*ModelDAO[T]) Updates

func (dao *ModelDAO[T]) Updates(data any) *ModelDAO[T]

func (*ModelDAO[T]) Where

func (dao *ModelDAO[T]) Where(query any, args ...any) *ModelDAO[T]

func (*ModelDAO[T]) WithContext

func (dao *ModelDAO[T]) WithContext(ctx context.Context) *ModelDAO[T]

type ModelRepository

type ModelRepository struct {
	// contains filtered or unexported fields
}

func (*ModelRepository) GetClient

func (repository *ModelRepository) GetClient() *Client

func (*ModelRepository) SetClient

func (repository *ModelRepository) SetClient(client *Client)

type ModelService

type ModelService struct {
	// contains filtered or unexported fields
}

func (*ModelService) GetClient

func (service *ModelService) GetClient() *Client

func (*ModelService) Initialize

func (service *ModelService) Initialize()

func (*ModelService) SetClient

func (service *ModelService) SetClient(client *Client)

func (*ModelService) WithConnection

func (service *ModelService) WithConnection(operator ClientOperator, args ...any) error

func (*ModelService) WithTransaction

func (service *ModelService) WithTransaction(operator ClientOperator, args ...any) error

type PostgresClient

type PostgresClient = Client

func GetPostgresClient

func GetPostgresClient() *PostgresClient

func NewPostgresClient

func NewPostgresClient(options *PostgresClientOptions) *PostgresClient

type PostgresClientOptions

type PostgresClientOptions struct {
	DSN      *string
	Host     *string
	Port     *string
	Name     *string
	User     *string
	Password *string
}

type Session

type Session = gorm.Session

Jump to

Keyboard shortcuts

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