all repos — litestore @ ffc461c25dbfe61864d9ccf3449ce34355053bcc

A minimalist nosql document store.

types.nim

 1
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
import db_sqlite

type 
  EDatastoreExists* = object of Exception
  EDatastoreDoesNotExist* = object of Exception
  EDatastoreUnavailable* = object of Exception
  EInvalidTag* = object of Exception
  EDirectoryNotFound* = object of Exception
  Datastore* = object
    db*: TDbConn
    path*: string
  QueryOptions* = object
    single*:bool         
    limit*: int           
    orderby*: string      
    tags*: string
    search*: string
  TagExpression* = object
    tag*: string
    startswith*: bool
    endswith*: bool
    negated*: bool
  Operation* = enum opRun, opPack, opUnpack
  Settings* = object
    store*: Datastore
    address*: string
    port*: int
    operation*: Operation
    directory*: string
    file*: string

proc newQueryOptions*(): QueryOptions =
  return QueryOptions(single: false, limit: 0, orderby: "", tags: "", search: "")