package
Version:
v3.0.1
Opens a new window with list of versions in this module.
Published: Dec 26, 2023
License: Apache-2.0
Opens a new window with license information.
Imports: 6
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
Package mysql define mysql db operation
View Source
const DefaultLockLeaseAge = 10 * time.Second
DefaultLockLeaseAge define default db locker lease age
InitDb Connect db server and create database if not exists then switch to this database,
returns *gorm.DB, error
InitDbByDsn Connect db server by dsn and returns *gorm.DB, error
@param dsn
@param migrateLock
@return *gorm.DB
@return error
type Locker interface {
Lock()
UnLock()
}
Locker db lock
NewDbLocker new db locker
Source Files
¶
Click to show internal directories.
Click to hide internal directories.