aboutsummaryrefslogtreecommitdiff
path: root/sqlite3.go
diff options
context:
space:
mode:
authormattn <mattn.jp@gmail.com>2014-09-03 09:21:15 +0900
committermattn <mattn.jp@gmail.com>2014-09-03 09:21:15 +0900
commit0a0c543dc0e5cbfb66d5874c385ae87874da03fb (patch)
tree6b869a31ddb5b96b37896714d844d86c7f3df21e /sqlite3.go
parentAdd note about license of amalgamation code (diff)
parentAdd "date" to decltypes parsed as a unix time (diff)
downloadgolite-0a0c543dc0e5cbfb66d5874c385ae87874da03fb.tar.gz
golite-0a0c543dc0e5cbfb66d5874c385ae87874da03fb.tar.xz
Merge branch 'pr/135'
Diffstat (limited to 'sqlite3.go')
-rw-r--r--sqlite3.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/sqlite3.go b/sqlite3.go
index aac71ad..38eb942 100644
--- a/sqlite3.go
+++ b/sqlite3.go
@@ -479,7 +479,7 @@ func (rc *SQLiteRows) Next(dest []driver.Value) error {
case C.SQLITE_INTEGER:
val := int64(C.sqlite3_column_int64(rc.s.s, C.int(i)))
switch rc.decltype[i] {
- case "timestamp", "datetime":
+ case "timestamp", "datetime", "date":
dest[i] = time.Unix(val, 0)
case "boolean":
dest[i] = val > 0
@@ -510,7 +510,7 @@ func (rc *SQLiteRows) Next(dest []driver.Value) error {
s := C.GoString((*C.char)(unsafe.Pointer(C.sqlite3_column_text(rc.s.s, C.int(i)))))
switch rc.decltype[i] {
- case "timestamp", "datetime":
+ case "timestamp", "datetime", "date":
for _, format := range SQLiteTimestampFormats {
if dest[i], err = time.Parse(format, s); err == nil {
break