2015-08-17 10:05:08 -04:00
|
|
|
// +build cgo
|
|
|
|
|
2013-12-19 00:14:16 -05:00
|
|
|
package graphdb
|
|
|
|
|
2016-11-30 13:59:54 -05:00
|
|
|
import (
|
|
|
|
"database/sql"
|
|
|
|
|
|
|
|
_ "github.com/mattn/go-sqlite3" // registers sqlite
|
|
|
|
)
|
2013-12-19 00:14:16 -05:00
|
|
|
|
2015-06-16 05:51:27 -04:00
|
|
|
// NewSqliteConn opens a connection to a sqlite
|
|
|
|
// database.
|
2013-12-19 00:14:16 -05:00
|
|
|
func NewSqliteConn(root string) (*Database, error) {
|
|
|
|
conn, err := sql.Open("sqlite3", root)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
2014-12-02 06:02:25 -05:00
|
|
|
return NewDatabase(conn)
|
2013-12-19 00:14:16 -05:00
|
|
|
}
|