MCPcopy
hub / github.com/dnote/dnote / Begin

Method Begin

pkg/cli/database/sql.go:52–63  ·  view source on GitHub ↗

Begin begins a transaction

()

Source from the content-addressed store, hash-verified

50
51// Begin begins a transaction
52func (d *DB) Begin() (*DB, error) {
53 if db, ok := d.Conn.(sqlDb); ok && db != nil {
54 tx, err := db.Begin()
55 if err != nil {
56 return nil, err
57 }
58
59 return &DB{Conn: tx}, nil
60 }
61
62 return nil, errors.New("can't start transaction")
63}
64
65// Commit commits a transaction
66func (d *DB) Commit() error {

Callers

nothing calls this directly

Calls 2

NewMethod · 0.80
BeginMethod · 0.65

Tested by

no test coverage detected