Documentation ¶
Index ¶
- Variables
- func IsErrRecordNotFound(err error) bool
- type Association
- type Client
- type ClientBatcher
- type ClientModifier
- type ClientOperator
- type Config
- type DeleteAt
- type Dialector
- type Expression
- type Model
- type ModelDAO
- func (dao *ModelDAO[T]) Assign(dataset ...any) *ModelDAO[T]
- func (dao *ModelDAO[T]) Association(field string) *Association
- func (dao *ModelDAO[T]) Attrs(dataset ...any) *ModelDAO[T]
- func (dao *ModelDAO[T]) Clauses(expressions ...Expression) *ModelDAO[T]
- func (dao *ModelDAO[T]) Count(number *int64) *ModelDAO[T]
- func (dao *ModelDAO[T]) Create(data any) *ModelDAO[T]
- func (dao *ModelDAO[T]) CreateInBatches(data any, size int) *ModelDAO[T]
- func (dao *ModelDAO[T]) Debug() *ModelDAO[T]
- func (dao *ModelDAO[T]) Delete(data any, args ...any) *ModelDAO[T]
- func (dao *ModelDAO[T]) Distinct(args ...any) *ModelDAO[T]
- func (dao *ModelDAO[T]) Exec(sql string, args ...any) *ModelDAO[T]
- func (dao *ModelDAO[T]) Find(data any, args ...any) *ModelDAO[T]
- func (dao *ModelDAO[T]) FindInBatches(data any, size int, batcher ClientBatcher) *ModelDAO[T]
- func (dao *ModelDAO[T]) First(data any, args ...any) *ModelDAO[T]
- func (dao *ModelDAO[T]) FirstOrCreate(data any, args ...any) *ModelDAO[T]
- func (dao *ModelDAO[T]) FirstOrInit(data any, args ...any) *ModelDAO[T]
- func (dao *ModelDAO[T]) Get(key string) (any, bool)
- func (dao *ModelDAO[T]) GetClient() *Client
- func (dao *ModelDAO[T]) GetEntity() *T
- func (dao *ModelDAO[T]) GetError() error
- func (dao *ModelDAO[T]) Group(name string) *ModelDAO[T]
- func (dao *ModelDAO[T]) Having(query any, args ...any) *ModelDAO[T]
- func (dao *ModelDAO[T]) InnerJoins(query string, args ...any) *ModelDAO[T]
- func (dao *ModelDAO[T]) InstanceGet(key string) (any, bool)
- func (dao *ModelDAO[T]) InstanceSet(key string, value any) *ModelDAO[T]
- func (dao *ModelDAO[T]) Joins(query string, args ...any) *ModelDAO[T]
- func (dao *ModelDAO[T]) Last(data any, args ...any) *ModelDAO[T]
- func (dao *ModelDAO[T]) Limit(number int) *ModelDAO[T]
- func (dao *ModelDAO[T]) MapColumns(mappings map[string]string) *ModelDAO[T]
- func (dao *ModelDAO[T]) Model(entity *T) *ModelDAO[T]
- func (dao *ModelDAO[T]) Not(query any, args ...any) *ModelDAO[T]
- func (dao *ModelDAO[T]) Offset(offset int) *ModelDAO[T]
- func (dao *ModelDAO[T]) Omit(fields ...string) *ModelDAO[T]
- func (dao *ModelDAO[T]) Or(query any, args ...any) *ModelDAO[T]
- func (dao *ModelDAO[T]) Order(column any) *ModelDAO[T]
- func (dao *ModelDAO[T]) Pluck(field string, data any) *ModelDAO[T]
- func (dao *ModelDAO[T]) Preload(query string, args ...any) *ModelDAO[T]
- func (dao *ModelDAO[T]) Raw(sql string, args ...any) *ModelDAO[T]
- func (dao *ModelDAO[T]) Row() *sql.Row
- func (dao *ModelDAO[T]) Rows() (*sql.Rows, error)
- func (dao *ModelDAO[T]) Save(data any) *ModelDAO[T]
- func (dao *ModelDAO[T]) Scan(data any) *ModelDAO[T]
- func (dao *ModelDAO[T]) ScanRows(rows *sql.Rows, data any) error
- func (dao *ModelDAO[T]) Scopes(modifiers ...ClientModifier) *ModelDAO[T]
- func (dao *ModelDAO[T]) Select(query any, args ...any) *ModelDAO[T]
- func (dao *ModelDAO[T]) Session(config *Session) *ModelDAO[T]
- func (dao *ModelDAO[T]) Set(key string, value any) *ModelDAO[T]
- func (dao *ModelDAO[T]) SetClient(client *Client)
- func (dao *ModelDAO[T]) SetEntity(entity *T)
- func (dao *ModelDAO[T]) SetError(err error)
- func (dao *ModelDAO[T]) Table(name string, args ...any) *ModelDAO[T]
- func (dao *ModelDAO[T]) Take(data any, args ...any) *ModelDAO[T]
- func (dao *ModelDAO[T]) Unscoped() *ModelDAO[T]
- func (dao *ModelDAO[T]) Update(field string, value any) *ModelDAO[T]
- func (dao *ModelDAO[T]) UpdateColumn(field string, value any) *ModelDAO[T]
- func (dao *ModelDAO[T]) UpdateColumns(data any) *ModelDAO[T]
- func (dao *ModelDAO[T]) Updates(data any) *ModelDAO[T]
- func (dao *ModelDAO[T]) Where(query any, args ...any) *ModelDAO[T]
- func (dao *ModelDAO[T]) WithContext(ctx context.Context) *ModelDAO[T]
- type ModelRepository
- type ModelService
- func (service *ModelService) GetClient() *Client
- func (service *ModelService) Initialize()
- func (service *ModelService) SetClient(client *Client)
- func (service *ModelService) WithConnection(operator ClientOperator, args ...any) error
- func (service *ModelService) WithTransaction(operator ClientOperator, args ...any) error
- type PostgresClient
- type PostgresClientOptions
- type Session
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrRecordNotFound = gorm.ErrRecordNotFound
Functions ¶
func IsErrRecordNotFound ¶
Types ¶
type Association ¶
type Association = gorm.Association
type ClientBatcher ¶
type ClientModifier ¶
type ClientOperator ¶
type Expression ¶
type Expression = clause.Expression
type ModelDAO ¶
type ModelDAO[T any] struct { // contains filtered or unexported fields }
func (*ModelDAO[T]) Association ¶
func (dao *ModelDAO[T]) Association(field string) *Association
func (*ModelDAO[T]) Clauses ¶
func (dao *ModelDAO[T]) Clauses(expressions ...Expression) *ModelDAO[T]
func (*ModelDAO[T]) CreateInBatches ¶
func (*ModelDAO[T]) FindInBatches ¶
func (dao *ModelDAO[T]) FindInBatches(data any, size int, batcher ClientBatcher) *ModelDAO[T]
func (*ModelDAO[T]) FirstOrCreate ¶
func (*ModelDAO[T]) FirstOrInit ¶
func (*ModelDAO[T]) InnerJoins ¶
func (*ModelDAO[T]) InstanceSet ¶
func (*ModelDAO[T]) MapColumns ¶
func (*ModelDAO[T]) Scopes ¶
func (dao *ModelDAO[T]) Scopes(modifiers ...ClientModifier) *ModelDAO[T]
func (*ModelDAO[T]) UpdateColumn ¶
func (*ModelDAO[T]) UpdateColumns ¶
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 ¶
Click to show internal directories.
Click to hide internal directories.