forked from eaigner/jet
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtypes.go
More file actions
27 lines (22 loc) · 732 Bytes
/
types.go
File metadata and controls
27 lines (22 loc) · 732 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package jet
import (
"context"
"database/sql"
)
type Runnable interface {
// Run runs the query without returning results
Run() error
// Rows runs the query writing the rows to the specified map or struct array.
Rows(v interface{}) error
}
type queryObject interface {
Prepare(query string) (*sql.Stmt, error)
QueryContext(ctx context.Context, query string, args ...any) (*sql.Rows, error)
ExecContext(ctx context.Context, query string, args ...any) (sql.Result, error)
}
// ComplexValue implements methods for en/decoding custom values to a format the driver understands.
type ComplexValue interface {
Encode() interface{}
// Decode receives a plain value to decode, never a pointer.
Decode(v interface{}) error
}