@@ -9,15 +9,20 @@ import (
99 "time"
1010)
1111
12+ // StdSQLLegacy will potentially be removed in Go 2.
13+ type StdSQLLegacy interface {
14+ Exec (query string , args ... interface {}) (stdSql.Result , error )
15+ Prepare (query string ) (* stdSql.Stmt , error )
16+ Query (query string , args ... interface {}) (* stdSql.Rows , error )
17+ QueryRow (query string , args ... interface {}) * stdSql.Row
18+ }
19+
1220// StdSQLCommon is the interface that allows query and exec interactions with a database.
1321type StdSQLCommon interface {
14- Exec ( query string , args ... interface {}) (stdSql. Result , error )
22+ StdSQLLegacy
1523 ExecContext (ctx context.Context , query string , args ... interface {}) (stdSql.Result , error )
16- Prepare (query string ) (* stdSql.Stmt , error )
1724 PrepareContext (ctx context.Context , query string ) (* stdSql.Stmt , error )
18- Query (query string , args ... interface {}) (* stdSql.Rows , error )
1925 QueryContext (ctx context.Context , query string , args ... interface {}) (* stdSql.Rows , error )
20- QueryRow (query string , args ... interface {}) * stdSql.Row
2126 QueryRowContext (ctx context.Context , query string , args ... interface {}) * stdSql.Row
2227}
2328
@@ -30,7 +35,11 @@ type StdSQLDB interface {
3035 Begin () (* stdSql.Tx , error )
3136 BeginTx (ctx context.Context , opts * stdSql.TxOptions ) (* stdSql.Tx , error )
3237 Close () error
38+ }
3339
40+ // StdSQLDBExtra is the interface that directly maps to a *stdSql.DB.
41+ type StdSQLDBExtra interface {
42+ StdSQLDB
3443 Driver () driver.Driver
3544 SetConnMaxLifetime (d time.Duration )
3645 SetMaxIdleConns (n int )
0 commit comments