all repos — litestore @ aa4a88e1b0cae76cdc242c194db5e2d7b000bfab

A minimalist nosql document store.

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

aa4a88e1b0cae76cdc242c194db5e2d7b000bfab

parent

fb3391705c33a5f7b7a5a512d1bc6a044bb9cfdf

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"""