summaryrefslogtreecommitdiff
path: root/src/dbUtils.nim
diff options
context:
space:
mode:
authorJulien Dessaux2021-10-26 21:41:39 +0200
committerJulien Dessaux2021-10-26 21:41:39 +0200
commit7f79a49bff7883db126481f8c8a795aa312e3505 (patch)
treef04efeff6440f580a9f109686e1cb30822c40ad6 /src/dbUtils.nim
parentAdded 6 months expiration option (diff)
downloadshort-7f79a49bff7883db126481f8c8a795aa312e3505.tar.gz
short-7f79a49bff7883db126481f8c8a795aa312e3505.tar.bz2
short-7f79a49bff7883db126481f8c8a795aa312e3505.zip
cosmetics
Diffstat (limited to '')
-rw-r--r--src/dbUtils.nim16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/dbUtils.nim b/src/dbUtils.nim
index bdbcf14..cfe54cf 100644
--- a/src/dbUtils.nim
+++ b/src/dbUtils.nim
@@ -1,13 +1,13 @@
import std/times
import tiny_sqlite
-proc toDbValue*(t: DateTime): DbValue {.raises: [].}=
+proc toDbValue*(t: DateTime): DbValue {.raises: [].} =
DbValue(kind: sqliteText, strVal: $t)
-proc fromDbValue*(value: DbValue, T: typedesc[DateTime]): DateTime {.raises: [].}=
- try:
- case value.kind:
- of sqliteText: return times.parse(value.strVal, "yyyy-MM-dd'T'HH:mm:sszzz")
- else: return
- except TimeParseError:
- return
+proc fromDbValue*(value: DbValue, T: typedesc[DateTime]): DateTime {.raises: [].} =
+ try:
+ case value.kind:
+ of sqliteText: return times.parse(value.strVal, "yyyy-MM-dd'T'HH:mm:sszzz")
+ else: return
+ except TimeParseError:
+ return