forked from rocketlaunchr/dbq
-
Notifications
You must be signed in to change notification settings - Fork 0
/
interfaces.igo
40 lines (32 loc) · 972 Bytes
/
interfaces.igo
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
28
29
30
31
32
33
34
35
36
37
38
39
40
// Copyright 2019-20 PJ Engineering and Business Solutions Pty. Ltd. All rights reserved.
package dbq
import (
"context"
"database/sql"
rlSql "github.com/rocketlaunchr/mysql-go"
)
// ExecContexter is for modifying the database state.
type ExecContexter interface {
ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error)
}
// QueryContexter is for querying the database.
type QueryContexter interface {
QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error)
}
type queryContexter2 interface {
QueryContext(ctx context.Context, query string, args ...interface{}) (*rlSql.Rows, error)
}
// SQLBasic allows for querying and executing statements.
type SQLBasic interface {
ExecContexter
QueryContexter
}
type rows interface {
Close() error
ColumnTypes() ([]*sql.ColumnType, error)
Columns() ([]string, error)
Err() error
Next() bool
NextResultSet() bool
Scan(dest ...interface{}) error
}