all repos — litestore @ e72fc2b9f5df7119849daef3c04f605b888d63f3

A minimalist nosql document store.

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

e72fc2b9f5df7119849daef3c04f605b888d63f3

parent

8e6ac09dc1e2b6718172407fd6b69a2ec2213681

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: