SetRunnerOnContext sets the given runner within the context values.
(ctx *sql.Context, runner sql.StatementRunner)
| 145 | |
| 146 | // SetRunnerOnContext sets the given runner within the context values. |
| 147 | func SetRunnerOnContext(ctx *sql.Context, runner sql.StatementRunner) error { |
| 148 | if runner == nil { |
| 149 | return nil |
| 150 | } |
| 151 | cv, err := getContextValues(ctx) |
| 152 | if err != nil { |
| 153 | return err |
| 154 | } |
| 155 | cv.runner = runner |
| 156 | return nil |
| 157 | } |
| 158 | |
| 159 | // GetRunnerFromContext returns the sql.StatementRunner from within the context. |
| 160 | func GetRunnerFromContext(ctx *sql.Context) (sql.StatementRunner, error) { |
no test coverage detected