Documentation ¶
Overview ¶
Example ¶
driver := sqlhooks.Wrap(&sqlite3.SQLiteDriver{}, New()) sql.Register("sqlite3-logger", driver) db, _ := sql.Open("sqlite3-logger", ":memory:") // This query will output logs db.Query("SELECT 1+1")
Output:
Index ¶
- type Hook
- func (h *Hook) After(ctx context.Context, query string, args ...interface{}) (context.Context, error)
- func (h *Hook) Before(ctx context.Context, query string, args ...interface{}) (context.Context, error)
- func (h *Hook) OnError(ctx context.Context, err error, query string, args ...interface{}) error
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
Click to show internal directories.
Click to hide internal directories.