db

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Exists

func Exists[T any](db *DB, conds ...any) bool

func ParseStruct

func ParseStruct(in any) []string

Types

type DB

type DB struct {
	*gorm.DB
	// contains filtered or unexported fields
}

func (*DB) Base

func (db *DB) Base(dest any, conds ...any) *DB

func (*DB) Error

func (db *DB) Error() error

func (*DB) First

func (db *DB) First(x any, conds ...any) bool

func (*DB) FirstOrCreate

func (db *DB) FirstOrCreate(first, create func(), x any, conds ...any)

func (*DB) NoRecord

func (db *DB) NoRecord() bool

func (*DB) Preload

func (db *DB) Preload(t any, conds ...any) *DB

func (*DB) Preloads

func (db *DB) Preloads(t any, conds ...any) *DB

func (*DB) SetDB

func (db *DB) SetDB(r *gorm.DB) *DB

func (*DB) SetDialector

func (db *DB) SetDialector(dialector gorm.Dialector) *DB

func (*DB) SetSqlite

func (db *DB) SetSqlite(file string) *DB

type Model

type Model struct {
	ID uint64 `gorm:"primaryKey;autoIncrement" form:"-" json:"-"`
}

type NoCopy

type NoCopy struct{}

func (*NoCopy) Lock

func (*NoCopy) Lock()

Lock is a no-op used by -copylocks checker from `go vet`.

func (*NoCopy) Unlock

func (*NoCopy) Unlock()

Jump to

Keyboard shortcuts

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