all repos — litestore @ 354a9168b5c204f7f8fd7b91ddcc068a0c87cc17

A minimalist nosql document store.

Added optimization for folder retrieval.
h3rald h3rald@h3rald.com
Sat, 15 Sep 2018 21:54:58 +0200
commit

354a9168b5c204f7f8fd7b91ddcc068a0c87cc17

parent

4e3574b66676a22648211862a2524a213f6bf824

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

jump to
M lib/core.nimlib/core.nim

@@ -312,7 +312,7 @@ proc retrieveRawDocuments*(store: Datastore, options: var QueryOptions = newQueryOptions()): JsonNode =

var select = prepareSelectDocumentsQuery(options) var raw_documents: seq[Row] if options.folder != "": - raw_documents = store.db.getAllRows(select.sql, options.folder & "%") + raw_documents = store.db.getAllRows(select.sql, options.folder, options.folder & "{") else: raw_documents = store.db.getAllRows(select.sql) var documents = newSeq[JsonNode](0)
M lib/utils.nimlib/utils.nim

@@ -89,7 +89,7 @@ result = result & "AND modified > \"" & $options.modifiedAfter & "\" "

if options.modifiedBefore != "": result = result & "AND modified < \"" & $options.modifiedBefore & "\" " if options.folder.len > 0: - result = result & "AND " & doc_id_col & " LIKE ? " + result = result & "AND " & doc_id_col & " BETWEEN ? and ? " if options.tags.len > 0: result = result & options.tags.selectDocumentsByTags(doc_id_col) if options.jsonFilter.len > 0: