| 1 | // SPDX-License-Identifier: GPL-3.0-or-later |
| 2 | |
| 3 | package mysqlfunc |
| 4 | |
| 5 | import ( |
| 6 | "context" |
| 7 | "database/sql" |
| 8 | ) |
| 9 | |
| 10 | // Queryer is the minimal query-only surface used by function handlers. |
| 11 | // Collector retains ownership of connection lifecycle. |
| 12 | type Queryer interface { |
| 13 | QueryContext(ctx context.Context, query string, args ...any) (*sql.Rows, error) |
| 14 | QueryRowContext(ctx context.Context, query string, args ...any) *sql.Row |
| 15 | } |
| 16 | |
| 17 | // Deps defines the dependency surface required by mysql function handlers. |
| 18 | type Deps interface { |
| 19 | DB() (Queryer, error) |
| 20 | } |