Added optimization for folder retrieval.
h3rald h3rald@h3rald.com
Sat, 15 Sep 2018 21:54:58 +0200
2 files changed,
2 insertions(+),
2 deletions(-)
M
lib/core.nim
→
lib/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.nim
→
lib/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: