From 86932b40b0cebe3d5fc316bdb983a2ea8672cc4f Mon Sep 17 00:00:00 2001 From: romo Date: Mon, 13 Oct 2014 11:05:49 +0900 Subject: [PATCH] add Version func for retrieving SQLite library version info --- sqlite3.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sqlite3.go b/sqlite3.go index 94ebce3..24b6cfd 100644 --- a/sqlite3.go +++ b/sqlite3.go @@ -88,6 +88,14 @@ func init() { sql.Register("sqlite3", &SQLiteDriver{}) } +// Return SQLite library Version information. +func Version() (libVersion string, libVersionNumber int, sourceId string) { + libVersion = C.GoString(C.sqlite3_libversion()) + libVersionNumber = int(C.sqlite3_libversion_number()) + sourceId = C.GoString(C.sqlite3_sourceid()) + return libVersion, libVersionNumber, sourceId +} + // Driver struct. type SQLiteDriver struct { Extensions []string