Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DSN ¶
type DSN struct { Username string Password string URL string Port string DBName string SkipTran bool PreStmt bool LogLevel int }
DSN 连接数据库路由参数
type IGormOpt ¶
type IGormOpt interface { Close() IsConflictErr(err error) bool CreateTable(dst any) error ExecSQL(sql string, values ...any) (int64, error) Query(dest any, stmt string, values ...any) error Insert(value any, conds ...clause.Expression) error InsertTb(tb string, value any, conds ...clause.Expression) error BatchInsert(value any, batchSize int, conds ...clause.Expression) error BatchInsertTb(tb string, value any, batchSize int, conds ...clause.Expression) error QueryRows(hand func(*gorm.DB, *sql.Rows) error, sql string, values ...any) error QueryRow(hand func(*gorm.DB, *sql.Row) error, sql string, values ...any) error GetGormDB() *gorm.DB }
IGormOpt Gorm操作接口
func MustOpenPostgres ¶
MustOpenPostgres 无错的连接Postgres返回*gorm.DB
Click to show internal directories.
Click to hide internal directories.