Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetTimerLogger ¶
func SetTimerLogger(tl TimerLogger)
func SetTimerLoggerFunc ¶
func SetTimerLoggerFunc(lf TimerLoggerFunc)
Types ¶
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
func (*Conn) Close ¶
Close invalidates and potentially stops any current prepared statements and transactions, marking this connection as no longer in use.
Because the sql package maintains a free pool of connections and only calls Close when there's a surplus of idle connections, it shouldn't be necessary for drivers to do their own connection caching.
type Driver ¶
type Driver struct {
// contains filtered or unexported fields
}
func (*Driver) Open ¶
Open returns a new connection to the database. The name is a string in a driver-specific format.
Open may return a cached connection (one previously closed), but doing so is unnecessary; the sql package maintains a pool of idle connections for efficient re-use.
The returned connection is only used by one goroutine at a time.
type NoExecConn ¶
type NoExecConn struct {
// contains filtered or unexported fields
}
func (*NoExecConn) Begin ¶
func (c *NoExecConn) Begin() (driver.Tx, error)
Begin starts and returns a new transaction.
func (*NoExecConn) Close ¶
func (c *NoExecConn) Close() error
Close invalidates and potentially stops any current prepared statements and transactions, marking this connection as no longer in use.
Because the sql package maintains a free pool of connections and only calls Close when there's a surplus of idle connections, it shouldn't be necessary for drivers to do their own connection caching.
type Stmt ¶
type Stmt struct {
// contains filtered or unexported fields
}
func (*Stmt) Close ¶
Close closes the statement.
As of Go 1.1, a Stmt will not be closed if it's in use by any queries.
func (*Stmt) NumInput ¶
NumInput returns the number of placeholder parameters.
If NumInput returns >= 0, the sql package will sanity check argument counts from callers and return errors to the caller before the statement's Exec or Query methods are called.
NumInput may also return -1, if the driver doesn't know its number of placeholders. In that case, the sql package will not sanity check Exec or Query argument counts.
type TimerLogger ¶
type TimerLogger interface {
Log(TimerInfo)
}
type TimerLoggerFunc ¶
type TimerLoggerFunc func(TimerInfo)
func (TimerLoggerFunc) Log ¶
func (tlf TimerLoggerFunc) Log(ti TimerInfo)