mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
018f19f8c9
Signed-off-by: John Howard <jhoward@microsoft.com>
(cherry picked from commit 3f6127b173
)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
19 lines
334 B
Go
19 lines
334 B
Go
// +build cgo
|
|
|
|
package graphdb
|
|
|
|
import (
|
|
"database/sql"
|
|
|
|
_ "github.com/mattn/go-sqlite3" // registers sqlite
|
|
)
|
|
|
|
// NewSqliteConn opens a connection to a sqlite
|
|
// database.
|
|
func NewSqliteConn(root string) (*Database, error) {
|
|
conn, err := sql.Open("sqlite3", root)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return NewDatabase(conn)
|
|
}
|