From 1e280555b7a56165ad13eac5ba30f72d1243e8d6 Mon Sep 17 00:00:00 2001 From: Philip O Toole Date: Tue, 23 Feb 2016 01:20:57 -0500 Subject: Fix minor typos in comments --- doc.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'doc.go') diff --git a/doc.go b/doc.go index a45d852..597c75f 100644 --- a/doc.go +++ b/doc.go @@ -1,7 +1,7 @@ /* Package sqlite3 provides interface to SQLite3 databases. -This works as driver for database/sql. +This works as a driver for database/sql. Installation @@ -9,7 +9,7 @@ Installation Supported Types -Currently, go-sqlite3 support following data types. +Currently, go-sqlite3 supports the following data types. +------------------------------+ |go | sqlite3 | @@ -26,8 +26,8 @@ Currently, go-sqlite3 support following data types. SQLite3 Extension -You can write your own extension module for sqlite3. For example, below is a -extension for Regexp matcher operation. +You can write your own extension module for sqlite3. For example, below is an +extension for a Regexp matcher operation. #include #include @@ -63,8 +63,8 @@ extension for Regexp matcher operation. (void*)db, regexp_func, NULL, NULL); } -It need to build as so/dll shared library. And you need to register -extension module like below. +It needs to be built as a so/dll shared library. And you need to register +the extension module like below. sql.Register("sqlite3_with_extensions", &sqlite3.SQLiteDriver{ @@ -79,9 +79,9 @@ Then, you can use this extension. Connection Hook -You can hook and inject your codes when connection established. database/sql -doesn't provide the way to get native go-sqlite3 interfaces. So if you want, -you need to hook ConnectHook and get the SQLiteConn. +You can hook and inject your code when the connection is established. database/sql +doesn't provide a way to get native go-sqlite3 interfaces. So if you want, +you need to set ConnectHook and get the SQLiteConn. sql.Register("sqlite3_with_hook_example", &sqlite3.SQLiteDriver{ -- cgit v1.2.3 From 7b2244eaa4dd69583f99510c2657670afdf721ae Mon Sep 17 00:00:00 2001 From: Tim Retout Date: Thu, 24 Mar 2016 15:58:39 +0000 Subject: Fix sqlite "regexp" function name in documentation --- doc.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc.go') diff --git a/doc.go b/doc.go index 597c75f..c721f77 100644 --- a/doc.go +++ b/doc.go @@ -102,7 +102,7 @@ call RegisterFunction from ConnectHook. sql.Register("sqlite3_with_go_func", &sqlite3.SQLiteDriver{ ConnectHook: func(conn *sqlite3.SQLiteConn) error { - return conn.RegisterFunc("regex", regex, true) + return conn.RegisterFunc("regexp", regex, true) }, }) -- cgit v1.2.3 From 98981b4a3bc61c9f76cd54c691f1262041973c3e Mon Sep 17 00:00:00 2001 From: Filippo Valsorda Date: Sat, 3 Sep 2016 20:02:56 +0100 Subject: Make Go 1.7 fail compilation The package is useless without cgo, but Go 1.7 will happily build it since doc.go is a pure-Go file, even if CGO_ENABLED=0, like when cross-compiling. This is particularly problematic since the package is usually imported for its side effects, and users would successfully build a broken binary. Workaround golang/go#16981 --- doc.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'doc.go') diff --git a/doc.go b/doc.go index c721f77..030cd93 100644 --- a/doc.go +++ b/doc.go @@ -110,3 +110,5 @@ See the documentation of RegisterFunc for more details. */ package sqlite3 + +import "C" -- cgit v1.2.3 From 5811704cf608c808d720fe1a172864cf41406efd Mon Sep 17 00:00:00 2001 From: Mark Bates Date: Wed, 18 Jan 2017 17:14:12 +0100 Subject: Removing an unused C import to allow for "buildable" go files. Fixes https://github.com/mattn/go-sqlite3/issues/374 --- doc.go | 2 -- 1 file changed, 2 deletions(-) (limited to 'doc.go') diff --git a/doc.go b/doc.go index 030cd93..c721f77 100644 --- a/doc.go +++ b/doc.go @@ -110,5 +110,3 @@ See the documentation of RegisterFunc for more details. */ package sqlite3 - -import "C" -- cgit v1.2.3