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