// Open opens a repo database. func Open(path string) (*DB, error) { db, err := sql.Open("sqlite3", path) if err != nil { return nil, err } return &DB{db: sqlutil.Wrap(db)}, nil }
func newSpace(st store.Store, tx *sql.Tx, id int64, ro bool) ( *space, error, ) { w := sqlutil.Wrap(tx) s, err := loadSpace(st, w, id, ro) if err != nil { tx.Rollback() return nil, err } return &space{ tx: tx, w: w, s: s, id: id, timeLoaded: time.Now(), }, nil }
func wrapBack(db *sql.DB) *back { return &back{ conn: db, db: sqlutil.Wrap(db), } }
// Wrap wraps a repo database with the opened database. func Wrap(db *sql.DB) *DB { return &DB{db: sqlutil.Wrap(db), conn: db} }