dbtools

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Core

func Core() *gorm.DB

func DB

func DB(name string) *gorm.DB

func DoInitModels

func DoInitModels(imfs ...InitModelFunc) error

func InitModel

func InitModel(db *gorm.DB, models ...interface{}) error

工具类,自动生成表结构,gorm中的AutoMIGRATE

func InitMutilMySQL

func InitMutilMySQL(dburls map[string]string) error

func InitMySQL

func InitMySQL(name, dburl string) (*gorm.DB, error)

func InitSQLite

func InitSQLite(name, dburl string) (*gorm.DB, error)

func InsertOrUpdate

func InsertOrUpdate(db *gorm.DB, v interface{}, columns ...string) error

func Std

func Std() *gorm.DB

Types

type InitModelFunc

type InitModelFunc func() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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