2015-08-17 14:05:08 +00:00
|
|
|
// +build cgo
|
|
|
|
|
2013-12-23 23:33:06 +00:00
|
|
|
package graphdb
|
|
|
|
|
2015-05-30 23:05:12 +00:00
|
|
|
import "database/sql"
|
2013-12-23 23:33:06 +00:00
|
|
|
|
2015-06-16 09:51:27 +00:00
|
|
|
// NewSqliteConn opens a connection to a sqlite
|
|
|
|
// database.
|
2013-12-23 23:33:06 +00:00
|
|
|
func NewSqliteConn(root string) (*Database, error) {
|
|
|
|
conn, err := sql.Open("sqlite3", root)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
2014-12-02 11:02:25 +00:00
|
|
|
return NewDatabase(conn)
|
2013-12-23 23:33:06 +00:00
|
|
|
}
|