github.com/gdevillele/moby@v1.13.0/pkg/graphdb/conn_sqlite3_linux.go (about) 1 // +build cgo 2 3 package graphdb 4 5 import ( 6 "database/sql" 7 8 _ "github.com/mattn/go-sqlite3" // registers sqlite 9 ) 10 11 // NewSqliteConn opens a connection to a sqlite 12 // database. 13 func NewSqliteConn(root string) (*Database, error) { 14 conn, err := sql.Open("sqlite3", root) 15 if err != nil { 16 return nil, err 17 } 18 return NewDatabase(conn) 19 }