MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / New

Function New

storage/storage.go:126–137  ·  view source on GitHub ↗

New returns a new storage connected by dsn.

(dsn string)

Source from the content-addressed store, hash-verified

124
125// New returns a new storage connected by dsn.
126func New(dsn string) (st *Storage, err error) {
127 db, err := openDB(dsn)
128
129 if err != nil {
130 return
131 }
132
133 return &Storage{
134 dsn: dsn,
135 db: db,
136 }, nil
137}
138
139// Prepare implements prepare method of two-phase commit worker.
140func (s *Storage) Prepare(ctx context.Context, wb twopc.WriteBatch) (err error) {

Callers 4

newSQLiteStorageFunction · 0.92
initStorageFunction · 0.92
TestBadTypeFunction · 0.70
TestStorageFunction · 0.70

Calls 1

openDBFunction · 0.85

Tested by 3

newSQLiteStorageFunction · 0.74
TestBadTypeFunction · 0.56
TestStorageFunction · 0.56