database

package
v4.0.0-alpha.7 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AutoMigrate

func AutoMigrate(models ...any) error

AutoMigrate 鑷姩杩佺Щ鏁版嵁搴撹〃

func Close

func Close() error

Close 鍏抽棴鏁版嵁搴撹繛鎺?

func Get

func Get() *gorm.DB

Get 鑾峰彇鏁版嵁搴撳疄渚?

func GetDB

func GetDB() *gorm.DB

GetDB 鑾峰彇鏁版嵁搴撳疄渚?

func Init

func Init(cfg *config.DatabaseConfig) error

Init 鍒濆鍖栨暟鎹簱杩炴帴

func IsPostgres

func IsPostgres() bool

IsPostgres 妫€鏌ユ槸鍚︿娇鐢?PostgreSQL

func IsSQLite

func IsSQLite() bool

IsSQLite 妫€鏌ユ槸鍚︿娇鐢?SQLite

func Reset

func Reset()

Reset resets the database state (for testing only)

Types

This section is empty.

Jump to

Keyboard shortcuts

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