aboutsummaryrefslogtreecommitdiff
path: root/sqlite3.go
diff options
context:
space:
mode:
authorDavid Anderson <dave@natulte.net>2015-08-21 17:12:18 -0700
committerDavid Anderson <dave@natulte.net>2015-08-21 17:12:18 -0700
commitb037a616903746de8e647f53503d4edca29192ec (patch)
tree3045643b1c3243ab76ed54348f1cc6c0fc64965b /sqlite3.go
parentImplement support for variadic functions. (diff)
downloadgolite-b037a616903746de8e647f53503d4edca29192ec.tar.gz
golite-b037a616903746de8e647f53503d4edca29192ec.tar.xz
Add support for interface{} arguments in Go SQLite functions.
This enabled support for functions like Foo(a interface{}) and Bar(a ...interface{}).
Diffstat (limited to 'sqlite3.go')
-rw-r--r--sqlite3.go13
1 files changed, 8 insertions, 5 deletions
diff --git a/sqlite3.go b/sqlite3.go
index 8bb9826..73e67e3 100644
--- a/sqlite3.go
+++ b/sqlite3.go
@@ -232,11 +232,14 @@ func (tx *SQLiteTx) Rollback() error {
// RegisterFunc makes a Go function available as a SQLite function.
//
-// The function can accept arguments of any real numeric type
-// (i.e. not complex), as well as []byte and string. It must return a
-// value of one of those types, and optionally an error as a second
-// value. Variadic functions are allowed, if the variadic argument is
-// one of the allowed types.
+// The Go function can have arguments of the following types: any
+// numeric type except complex, bool, []byte, string and
+// interface{}. interface{} arguments are given the direct translation
+// of the SQLite data type: int64 for INTEGER, float64 for FLOAT,
+// []byte for BLOB, string for TEXT.
+//
+// The function can additionally be variadic, as long as the type of
+// the variadic argument is one of the above.
//
// If pure is true. SQLite will assume that the function's return
// value depends only on its inputs, and make more aggressive