MCPcopy Index your code
hub / github.com/dnote/dnote / Open

Function Open

pkg/cli/database/sql.go:119–131  ·  view source on GitHub ↗

Open initializes a new connection to the sqlite database

(dbPath string)

Source from the content-addressed store, hash-verified

117
118// Open initializes a new connection to the sqlite database
119func Open(dbPath string) (*DB, error) {
120 dbConn, err := sql.Open("sqlite3", dbPath)
121 if err != nil {
122 return nil, errors.Wrap(err, "opening db connection")
123 }
124
125 db := &DB{
126 Conn: dbConn,
127 Filepath: dbPath,
128 }
129
130 return db, nil
131}

Callers 8

TestDBPathFlagFunction · 0.92
newBaseCtxFunction · 0.92
generateSchemaFunction · 0.92
MustOpenDatabaseFunction · 0.92
InitTestCtxWithFileDBFunction · 0.92
InitTestFileDBRawFunction · 0.70
InitTestMemoryDBRawFunction · 0.70
OpenTestDBFunction · 0.70

Calls 1

OpenMethod · 0.80

Tested by 1

TestDBPathFlagFunction · 0.74