|
| 1 | +package sqlx |
| 2 | + |
| 3 | +import ( |
| 4 | + "context" |
| 5 | + "database/sql" |
| 6 | +) |
| 7 | + |
| 8 | +var ( |
| 9 | + _ Queryable = (*DB)(nil) |
| 10 | + _ Queryable = (*Tx)(nil) |
| 11 | +) |
| 12 | + |
| 13 | +// Queryable includes all methods shared by sqlx.DB and sqlx.Tx, allowing |
| 14 | +// either type to be used interchangeably. |
| 15 | +type Queryable interface { |
| 16 | + Ext |
| 17 | + ExecIn |
| 18 | + QueryIn |
| 19 | + ExecerContext |
| 20 | + PreparerContext |
| 21 | + QueryerContext |
| 22 | + Preparer |
| 23 | + |
| 24 | + GetContext(context.Context, interface{}, string, ...interface{}) error |
| 25 | + SelectContext(context.Context, interface{}, string, ...interface{}) error |
| 26 | + Get(interface{}, string, ...interface{}) error |
| 27 | + MustExecContext(context.Context, string, ...interface{}) sql.Result |
| 28 | + PreparexContext(context.Context, string) (*Stmt, error) |
| 29 | + QueryRowContext(context.Context, string, ...interface{}) *sql.Row |
| 30 | + Select(interface{}, string, ...interface{}) error |
| 31 | + QueryRow(string, ...interface{}) *sql.Row |
| 32 | + PrepareNamedContext(context.Context, string) (*NamedStmt, error) |
| 33 | + PrepareNamed(string) (*NamedStmt, error) |
| 34 | + Preparex(string) (*Stmt, error) |
| 35 | + NamedExec(string, interface{}) (sql.Result, error) |
| 36 | + NamedExecContext(context.Context, string, interface{}) (sql.Result, error) |
| 37 | + MustExec(string, ...interface{}) sql.Result |
| 38 | + NamedQuery(string, interface{}) (*Rows, error) |
| 39 | + InGet(any, string, ...any) error |
| 40 | + InSelect(any, string, ...any) error |
| 41 | + InExec(query string, args ...any) (sql.Result, error) |
| 42 | + MustInExec(string, ...any) sql.Result |
| 43 | +} |
0 commit comments