ketin/data/query

Source   Edit  

Types

EmptyColumn = object
representation of nil node passed to users Source   Edit  
RawRow = seq[RawNimNode]
Source   Edit  

Procs

proc addRawRow(id: SchemaId; row: RawRow) {.
    ...raises: [ValueError, GlazeError, FrozenError], tags: [], forbids: [].}
Source   Edit  
proc applyRow(call: NimNode; row: RawRow) {....raises: [], tags: [], forbids: [].}
Source   Edit  
proc copyApplyPattern(root: NimNode): NimNode {....raises: [], tags: [],
    forbids: [].}
Source   Edit  
proc currentCount(id: SchemaId): int {....raises: [], tags: [], forbids: [].}
Source   Edit  
proc defineRowAdd(id: SchemaId; rawName: NimNode;
                  initialParams: seq[NimNode] = @[newEmptyNode()];
                  genericParams: NimNode = nil): NimNode {.
    ...raises: [GlazeError, ValueError], tags: [], forbids: [].}
Source   Edit  
proc doChoice(id: SchemaId; column: int): NimNode {.
    ...raises: [ValueError, GlazeError, NotFrozenError], tags: [], forbids: [].}
Source   Edit  
proc doCollect(id: SchemaId; column: int; result: NimNode) {.
    ...raises: [ValueError, GlazeError, NotFrozenError], tags: [], forbids: [].}
Source   Edit  
proc doCount(id: SchemaId; column: int): int {.
    ...raises: [ValueError, GlazeError, NotFrozenError], tags: [], forbids: [].}
Source   Edit  
proc doDispatch(id: SchemaId; column: int; value: NimNode; callPattern: NimNode;
                elseBody: NimNode): NimNode {.
    ...raises: [ValueError, GlazeError, NotFrozenError], tags: [], forbids: [].}

generates a case statement for value based on the values of column, calls callPattern with found row

if elseBody is not nil, generates else

Source   Edit  
proc doFind[T](id: SchemaId; column: int; value: T; call: NimNode;
               elseBody: NimNode): NimNode
checks for equality to value in the static values of column, calls call with found row, otherwise returns elseBody Source   Edit  
proc doPick(id: SchemaId; column: int; ignoreRest = true): tuple[found: int,
    value: NimNode] {....raises: [ValueError, GlazeError, NotFrozenError],
                      tags: [], forbids: [].}
Source   Edit  
proc doUnravel(id: SchemaId; callPattern: NimNode): NimNode {.
    ...raises: [ValueError, GlazeError, NotFrozenError], tags: [], forbids: [].}
generates statement list that calls callPattern with each row Source   Edit  
proc getSchemaData(id: SchemaId): CacheSeq {....raises: [], tags: [], forbids: [].}
Source   Edit  
proc makeApplicable(root: NimNode): NimNode {....raises: [], tags: [], forbids: [].}
Source   Edit  

Iterators

iterator eachRawRow(id: SchemaId): RawRow {.
    ...raises: [ValueError, GlazeError, NotFrozenError], tags: [], forbids: [].}
Source   Edit  

Templates

template columnExists(value: NimNode): bool
Source   Edit  
template isColumnEmpty(value: NimNode): bool
Source   Edit