nery

Types

KeyVal = object
  key, val: string
NeryKind = enum
  nkSelect, nkInsert
Id = object
  name*, alias*, prefix*: string
  arguments*: seq[Id]
ReferenceKind = enum
  rkId, rkFunction
Reference = object
  alias*, prefix*: string
  case kind*: ReferenceKind
  of rkId:
      id*: string

  of rkFunction:
      function*: string
      arguments*: seq[Reference]

  
Order = enum
  asc, desc
OrderBy = object
  reference*: Reference
  order*: Order
WhereKind = enum
  wkUnary, wkBinary
Where = object
  case kind*: WhereKind
  of wkUnary:
      val*: string

  of wkBinary:
      lhs*: Reference
      rhs*: Reference
      op*: string

  
Nery = ref object
  reference*: Reference
  case kind*: NeryKind
  of nkSelect:
      columns*: seq[Reference]
      orderBy*: seq[OrderBy]
      where*: seq[Where]

  of nkInsert:
      entries*: Table[string, string]

  

Procs

proc `==`(ref1, ref2: Reference): bool {...}{.raises: [], tags: [].}
proc `==`(where1, where2: Where): bool {...}{.raises: [], tags: [].}

Macros

macro nery(body: untyped): untyped