2023-06-10 13:09:25 +03:00
|
|
|
package wrapper
|
|
|
|
|
|
|
|
import (
|
|
|
|
"database/sql/driver"
|
|
|
|
)
|
|
|
|
|
2025-01-02 23:37:55 +03:00
|
|
|
/*
|
2023-06-10 13:09:25 +03:00
|
|
|
func wrapDriver(d driver.Driver, opts Options) driver.Driver {
|
|
|
|
if _, ok := d.(driver.DriverContext); ok {
|
|
|
|
return &wrapperDriver{driver: d, opts: opts}
|
|
|
|
}
|
|
|
|
return struct{ driver.Driver }{&wrapperDriver{driver: d, opts: opts}}
|
|
|
|
}
|
2025-01-02 23:37:55 +03:00
|
|
|
*/
|
2023-06-10 13:09:25 +03:00
|
|
|
|
|
|
|
// WrapConn allows an existing driver.Conn to be wrapped.
|
|
|
|
func WrapConn(c driver.Conn, opts ...Option) driver.Conn {
|
|
|
|
return wrapConn(c, NewOptions(opts...))
|
|
|
|
}
|