From 9998a8cb38887a6dfb845c7d17ff56ca6af1f5f3 Mon Sep 17 00:00:00 2001 From: John Howard Date: Sat, 30 May 2015 16:05:12 -0700 Subject: [PATCH] Windows: Statically linkable SQLite3 Signed-off-by: John Howard --- graphdb/conn_sqlite3.go | 9 +-------- graphdb/conn_sqlite3_unix.go | 5 +++++ graphdb/conn_sqlite3_windows.go | 5 +++++ 3 files changed, 11 insertions(+), 8 deletions(-) create mode 100644 graphdb/conn_sqlite3_unix.go create mode 100644 graphdb/conn_sqlite3_windows.go diff --git a/graphdb/conn_sqlite3.go b/graphdb/conn_sqlite3.go index 2be9112..47c6b72 100644 --- a/graphdb/conn_sqlite3.go +++ b/graphdb/conn_sqlite3.go @@ -1,12 +1,6 @@ -// +build cgo - package graphdb -import ( - "database/sql" - - _ "code.google.com/p/gosqlite/sqlite3" // registers sqlite -) +import "database/sql" // NewSqliteConn opens a connection to a sqlite // database. @@ -15,6 +9,5 @@ func NewSqliteConn(root string) (*Database, error) { if err != nil { return nil, err } - return NewDatabase(conn) } diff --git a/graphdb/conn_sqlite3_unix.go b/graphdb/conn_sqlite3_unix.go new file mode 100644 index 0000000..7ccb667 --- /dev/null +++ b/graphdb/conn_sqlite3_unix.go @@ -0,0 +1,5 @@ +// +build cgo,!windows + +package graphdb + +import _ "code.google.com/p/gosqlite/sqlite3" // registers sqlite diff --git a/graphdb/conn_sqlite3_windows.go b/graphdb/conn_sqlite3_windows.go new file mode 100644 index 0000000..fe56e1b --- /dev/null +++ b/graphdb/conn_sqlite3_windows.go @@ -0,0 +1,5 @@ +// +build cgo,windows + +package graphdb + +import _ "github.com/mattn/go-sqlite3" // registers sqlite