db

package
v0.0.27 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetMySQLDsn

func GetMySQLDsn(username, password, server, port, db, parameter string) string

GetMySQLDsn creates a MySQL DSN string. about DSN document. https://github.com/go-sql-driver/mysql#dsn-data-source-name

func GetPostgresDsn

func GetPostgresDsn(user, password, host, port, dbname, parameter string) string

GetPostgresDsn creates a Postgres DSN string.

func TransactionGorm

func TransactionGorm(db *gorm.DB, f func(db *gorm.DB) error) error

TransactionGorm automatically performs transactions (Begin/Commit/Rollback) between specified func...

Types

This section is empty.

Jump to

Keyboard shortcuts

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