From 4bc448f79b526c2ef42cd3feebc43f1b42adf9c9 Mon Sep 17 00:00:00 2001 From: Zbigniew Mandziejewicz Date: Mon, 18 Apr 2016 19:58:56 +0800 Subject: [PATCH 1/3] Disable LoadExtension when omit_load_extension is specified --- sqlite3_libsqlite3.go | 2 +- sqlite3_omit_load_extension.go | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/sqlite3_libsqlite3.go b/sqlite3_libsqlite3.go index 0c4c557..2408228 100644 --- a/sqlite3_libsqlite3.go +++ b/sqlite3_libsqlite3.go @@ -8,6 +8,6 @@ package sqlite3 /* #cgo CFLAGS: -DUSE_LIBSQLITE3 -#cgo LDFLAGS: -lsqlite3 +#cgo linux darwin LDFLAGS: -lsqlite3 */ import "C" diff --git a/sqlite3_omit_load_extension.go b/sqlite3_omit_load_extension.go index a80cf87..c7b3bfe 100644 --- a/sqlite3_omit_load_extension.go +++ b/sqlite3_omit_load_extension.go @@ -17,3 +17,7 @@ import ( func (c *SQLiteConn) loadExtensions(extensions []string) error { return errors.New("Extensions have been disabled for static builds") } + +func (c *SQLiteConn) LoadExtension(lib string, entry string) error { + return errors.New("Extensions have been disabled for static builds") +} From bce6ca75013bc60a05dc6d7ad718b7a3f23439fe Mon Sep 17 00:00:00 2001 From: Zbigniew Mandziejewicz Date: Mon, 18 Apr 2016 19:58:56 +0800 Subject: [PATCH 2/3] Disable LoadExtension when omit_load_extension is specified --- sqlite3_libsqlite3.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sqlite3_libsqlite3.go b/sqlite3_libsqlite3.go index 2408228..135863e 100644 --- a/sqlite3_libsqlite3.go +++ b/sqlite3_libsqlite3.go @@ -8,6 +8,7 @@ package sqlite3 /* #cgo CFLAGS: -DUSE_LIBSQLITE3 -#cgo linux darwin LDFLAGS: -lsqlite3 +#cgo linux LDFLAGS: -lsqlite3 +#cgo darwin LDFLAGS: -L/usr/local/opt/sqlite/lib -lsqlite3 */ import "C" From e8363dc69101744f6683b6131c48220c5da2d6e1 Mon Sep 17 00:00:00 2001 From: Zbigniew Mandziejewicz Date: Mon, 18 Apr 2016 20:19:08 +0800 Subject: [PATCH 3/3] Instructions for libsqlite3 on OS X --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index d69e305..1092c9b 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,11 @@ FAQ Use `go build --tags "libsqlite3 linux"` +* Want to build go-sqlite3 with libsqlite3 on OS X. + + Install sqlite3 from homebrew: `brew install sqlite3` + Use `go build --tags "libsqlite3 darwin"` + * Want to build go-sqlite3 with icu extension. Use `go build --tags "icu"`