Documentation
¶
Index ¶
Constants ¶
View Source
const (
UniqueViolationCode = "23505"
)
Variables ¶
View Source
var ( ErrNilQuery = errors.New("sql query cannot be nil") ErrNilRow = errors.New("sql row cannot be nil") )
Functions ¶
func CreateTransaction ¶
CreateTransaction creates a transaction for the database
func IsUniqueViolationError ¶ added in v0.4.3
IsUniqueViolationError checks if the error is a unique violation error
Types ¶
type Config ¶ added in v0.4.6
type Config struct { DB *sql.DB MaxOpenConnections *int MaxIdleConnections *int ConnectionMaxLifetime *time.Duration }
Config struct
func NewConfig ¶ added in v0.4.6
func NewConfig( maxOpenConnections *int, maxIdleConnections *int, connectionMaxLifetime *time.Duration, ) *Config
NewConfig creates a new configuration
Click to show internal directories.
Click to hide internal directories.