Documentation
¶
Index ¶
- Variables
- func Connect(host string, port int, username string, password string, database string, ...) (*gorm.DB, error)
- func HandleSQLError(err error) error
- func NewPSQLBackend(lockedBy string, lockExpirationDuration time.Duration, ...) backend.Backend
- func PrepareDB(db *gorm.DB) error
- func TruncateDB(db *gorm.DB) error
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultConnectConfig = &gorm.Config{ DisableForeignKeyConstraintWhenMigrating: true, Logger: logger.New( log.New(os.Stdout, "\r\n", log.LstdFlags), logger.Config{ SlowThreshold: time.Second, LogLevel: logger.Silent, IgnoreRecordNotFoundError: true, ParameterizedQueries: true, Colorful: false, }, ), }
Functions ¶
func HandleSQLError ¶
func NewPSQLBackend ¶
func PrepareDB ¶
PrepareDB only use for testing, don't use this function in production!. You should manually create tables instead
func TruncateDB ¶
TruncateDB only use for testing, don't use this function in production!
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.