Newer
Older
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
package db
import (
"code.electrolab.fr/it/vote.electrolab.fr/service"
"context"
"database/sql"
)
type dataCommands interface {
ExecContext(ctx context.Context, query string, args ...interface{}) (Result, error)
QueryContext(ctx context.Context, query string, args ...interface{}) (Rows, error)
QueryRowContext(ctx context.Context, query string, args ...interface{}) Row
}
type Service interface {
service.Service
dataCommands
Begin() (Tx, error)
}
type Tx interface {
dataCommands
Commit() error
Rollback() error
}
type Result interface {
sql.Result
}
type Row interface {
Scan(dest ...interface{}) error
}
type Rows interface {
Row
Close() error
Err() error
Next() bool
}