Documentation
¶
Index ¶
- type DB
- func (db *DB) AutoMigrate(models ...any) error
- func (db *DB) Begin(ctx context.Context) *gorm.DB
- func (db *DB) Client() *gorm.DB
- func (db *DB) Create(ctx context.Context, value any, clauses []clause.Expression) *gorm.DB
- func (db *DB) Delete(ctx context.Context, value any, clauses []clause.Expression) *gorm.DB
- func (db *DB) Exec(ctx context.Context, sql string, clauses []clause.Expression, values ...any) *gorm.DB
- func (db *DB) First(ctx context.Context, dest any, conds ...any) *gorm.DB
- func (db *DB) Raw(ctx context.Context, sql string, clauses []clause.Expression, values ...any) *gorm.DB
- func (db *DB) Save(ctx context.Context, value any, clauses []clause.Expression) *gorm.DB
- func (db *DB) Transaction(ctx context.Context, fn func(*DB) error) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
func (*DB) AutoMigrate ¶
func (*DB) Transaction ¶ added in v0.11.1
Transaction runs fn with a DB wrapper bound to one GORM transaction. Every helper called on the callback value uses that transaction rather than the root connection. The transaction commits when fn returns nil and rolls back otherwise.
Click to show internal directories.
Click to hide internal directories.