all repos — litestore @ b22720e1358e0fade1f6009d1c52d20a81ea43ab

A minimalist nosql document store.

Setting document modified when created.
h3rald h3rald@h3rald.com
Fri, 15 May 2020 17:25:50 +0200
commit

b22720e1358e0fade1f6009d1c52d20a81ea43ab

parent

bf9644df30eb49e13be0863d9c857e2f8f5a1b11

2 files changed, 4 insertions(+), 3 deletions(-)

jump to
M src/litestorepkg/lib/core.nimsrc/litestorepkg/lib/core.nim

@@ -297,8 +297,9 @@ # Store document

try: LOG.debug("Creating document '$1'" % id) store.begin() + let time = currentTime() var res = store.db.insertID(SQL_INSERT_DOCUMENT, id, data, contenttype, - binary, searchable, currentTime()) + binary, searchable, time, time) if res > 0: store.db.exec(SQL_INCREMENT_DOCS) if binary <= 0 and searchable >= 0:
M src/litestorepkg/lib/queries.nimsrc/litestorepkg/lib/queries.nim

@@ -101,8 +101,8 @@ """

const SQL_INSERT_DOCUMENT* = sql""" INSERT INTO documents -(id, data, content_type, binary, searchable, created) -VALUES (?, ?, ?, ?, ?, ?) +(id, data, content_type, binary, searchable, created, modified) +VALUES (?, ?, ?, ?, ?, ?, ?) """ const SQL_INSERT_SYSTEM_DOCUMENT* = sql"""