-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtransaction.go
45 lines (33 loc) · 1.02 KB
/
transaction.go
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
41
42
43
44
45
package dalgo2sql
import (
"context"
"database/sql"
"github.com/dal-go/dalgo/dal"
)
var _ dal.Transaction = (*transaction)(nil)
type transaction struct {
tx *sql.Tx
sqlOptions Options // TODO: document why & how to use
txOptions dal.TransactionOptions
}
func (t transaction) Options() dal.TransactionOptions {
return t.txOptions
}
func (t readwriteTransaction) ID() string {
return ""
}
func (t transaction) Select(ctx context.Context, query dal.Query) (dal.Reader, error) {
panic("implement me") // TODO: implement me
}
var _ dal.ReadTransaction = (*readTransaction)(nil)
type readTransaction = transaction
func (t readTransaction) QueryReader(c context.Context, query dal.Query) (dal.Reader, error) {
//TODO implement me
panic("implement me")
}
func (t readTransaction) QueryAllRecords(ctx context.Context, query dal.Query) (records []dal.Record, err error) {
//TODO implement me
panic("implement me")
}
var _ dal.ReadwriteTransaction = (*readwriteTransaction)(nil)
type readwriteTransaction = readTransaction