2014-04-25 05:11:32 -04:00
|
|
|
// +build cgo
|
2014-01-31 05:16:42 -05:00
|
|
|
|
2013-12-19 00:14:16 -05:00
|
|
|
package graphdb
|
|
|
|
|
|
|
|
import (
|
|
|
|
"database/sql"
|
2014-05-30 20:44:00 -04:00
|
|
|
|
|
|
|
_ "code.google.com/p/gosqlite/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-05-30 20:44:00 -04:00
|
|
|
|
2014-12-02 06:02:25 -05:00
|
|
|
return NewDatabase(conn)
|
2013-12-19 00:14:16 -05:00
|
|
|
}
|