Documentation ¶
Index ¶
- Constants
- func Connect(dsn string, tls TLSOption, opts ...Option) *sql.DB
- func ConnectENV(dsn string, tls TLSOption, opts ...Option) *sql.DB
- func MustConnect(dsn string, tls TLSOption, opts ...Option) *sql.DB
- func MustConnectENV(dsn string, tls TLSOption, opts ...Option) *sql.DB
- func ParseMySQLDateTime(t string) time.Time
- type Option
- type TLSOption
Constants ¶
View Source
const ( FmtTimestampDay = datetimes.FmtTimestampDay FmtTimestampHour = datetimes.FmtTimestampHour FmtTimestampMinute = datetimes.FmtTimestampMinute FmtDateTime = datetimes.FmtDateTime FmtDate = datetimes.FmtDate FmtTime = datetimes.FmtTime // mysql datetime format strings MySQLFmtDatetime = "%Y-%m-%d %H:%i:%s" MySQLFmtMinute = "%Y-%m-%d %H:%i" MySQLFmtHour = "%Y-%m-%d %H" MySQLFmtDay = "%Y-%m-%d" )
View Source
const (
ERR_UNDEFINED_DSN = "connection error: MySQL DSN '%s' is undefined\n"
)
Variables ¶
This section is empty.
Functions ¶
func ConnectENV ¶
ConnectENV connects to the DSN at the given ENV VAR and fails quietly
func MustConnect ¶
MustConnect connects to the given DSN and fails loudly if unable to do so.
func MustConnectENV ¶
MustConnectENV connects to the DSN at the given ENV VAR and fails loudly if unable to do so.
func ParseMySQLDateTime ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.