db

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

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 NewDB

func NewDB(cli *gorm.DB) *DB

func (*DB) AutoMigrate

func (db *DB) AutoMigrate(models ...any) error

func (*DB) BeginDangerously

func (db *DB) BeginDangerously(ctx context.Context) *gorm.DB

TODO: this isn't actually good. we can commit even if the db is locked here. this is probably okay for the time being, but need to figure out a better solution. right now we only do this whenever we're importing a repo though so i'm mostly not worried, but it's still bad. e.g. when we do apply writes we should also be using a transcation but we don't right now

func (*DB) Create

func (db *DB) Create(ctx context.Context, value any, clauses []clause.Expression) *gorm.DB

func (*DB) Delete

func (db *DB) Delete(ctx context.Context, value any, clauses []clause.Expression) *gorm.DB

func (*DB) Exec

func (db *DB) Exec(ctx context.Context, sql string, clauses []clause.Expression, values ...any) *gorm.DB

func (*DB) First

func (db *DB) First(ctx context.Context, dest any, conds ...any) *gorm.DB

func (*DB) Lock

func (db *DB) Lock()

func (*DB) Raw

func (db *DB) Raw(ctx context.Context, sql string, clauses []clause.Expression, values ...any) *gorm.DB

func (*DB) Save

func (db *DB) Save(ctx context.Context, value any, clauses []clause.Expression) *gorm.DB

func (*DB) Unlock

func (db *DB) Unlock()

Jump to

Keyboard shortcuts

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