src/allographer/v1/query_builder/models/postgres/postgres_query

    Dark Mode
Search:
Group by:

Procs

proc `distinct`(self: PostgresQuery): PostgresQuery {....raises: [], tags: [].}
proc avg(self: PostgresQuery; column: string): Future[Option[float]] {.
    ...raises: [Exception, ValueError], tags: [RootEffect, WriteDirEffect,
    ReadDirEffect, ReadIOEffect, WriteIOEffect, TimeEffect].}
proc begin(self: PostgresConnections): owned(Future[void]) {.
    ...raises: [Exception], tags: [RootEffect, WriteDirEffect, ReadDirEffect,
                                ReadIOEffect, WriteIOEffect, TimeEffect].}
proc columns(self: PostgresQuery): Future[seq[string]] {.
    ...raises: [Exception, ValueError], tags: [RootEffect, WriteDirEffect,
    ReadDirEffect, ReadIOEffect, WriteIOEffect, TimeEffect].}
get columns sequence from table
proc commit(self: PostgresConnections): owned(Future[void]) {.
    ...raises: [Exception], tags: [RootEffect, WriteDirEffect, ReadDirEffect,
                                ReadIOEffect, WriteIOEffect, TimeEffect].}
proc count(self: PostgresQuery): Future[int] {....raises: [Exception, ValueError], tags: [
    RootEffect, WriteDirEffect, ReadDirEffect, ReadIOEffect, WriteIOEffect,
    TimeEffect].}
proc delete(self: PostgresQuery): owned(Future[void]) {....raises: [Exception], tags: [
    RootEffect, WriteDirEffect, ReadDirEffect, ReadIOEffect, WriteIOEffect,
    TimeEffect].}
proc delete(self: PostgresQuery; id: int; key = "id"): owned(Future[void]) {.
    ...raises: [Exception], tags: [RootEffect, WriteDirEffect, ReadDirEffect,
                                ReadIOEffect, WriteIOEffect, TimeEffect].}
proc exec(self: RawPostgresQuery): owned(Future[void]) {....raises: [Exception], tags: [
    RootEffect, WriteDirEffect, ReadDirEffect, ReadIOEffect, WriteIOEffect,
    TimeEffect].}
It is only used with raw()
proc find(self: PostgresQuery; id: int; key = "id"): Future[Option[JsonNode]] {.
    ...raises: [Exception, ValueError], tags: [RootEffect, WriteDirEffect,
    ReadDirEffect, ReadIOEffect, WriteIOEffect, TimeEffect].}
proc find(self: PostgresQuery; id: string; key = "id"): Future[Option[JsonNode]] {.
    ...raises: [Exception, ValueError], tags: [RootEffect, WriteDirEffect,
    ReadDirEffect, ReadIOEffect, WriteIOEffect, TimeEffect].}
proc find[T](self: PostgresQuery; id: int; typ: typedesc[T]; key = "id"): Future[
    Option[T]]
proc find[T](self: PostgresQuery; id: string; typ: typedesc[T]; key = "id"): Future[
    Option[T]]
proc findPlain(self: PostgresQuery; id: int; key = "id"): Future[seq[string]] {.
    ...raises: [Exception, ValueError], tags: [RootEffect, WriteDirEffect,
    ReadDirEffect, ReadIOEffect, WriteIOEffect, TimeEffect].}
proc findPlain(self: PostgresQuery; id: string; key = "id"): Future[seq[string]] {.
    ...raises: [Exception, ValueError], tags: [RootEffect, WriteDirEffect,
    ReadDirEffect, ReadIOEffect, WriteIOEffect, TimeEffect].}
proc first(self: PostgresQuery): Future[Option[JsonNode]] {.
    ...raises: [Exception, ValueError], tags: [RootEffect, WriteDirEffect,
    ReadDirEffect, ReadIOEffect, WriteIOEffect, TimeEffect].}
proc first(self: RawPostgresQuery): Future[Option[JsonNode]] {.
    ...raises: [Exception, ValueError], tags: [RootEffect, WriteDirEffect,
    ReadDirEffect, ReadIOEffect, WriteIOEffect, TimeEffect].}
It is only used with raw()
proc first[T](self: PostgresQuery; typ: typedesc[T]): Future[Option[T]]
proc firstPlain(self: PostgresQuery): Future[seq[string]] {.
    ...raises: [Exception, ValueError], tags: [RootEffect, WriteDirEffect,
    ReadDirEffect, ReadIOEffect, WriteIOEffect, TimeEffect].}
proc firstPlain(self: RawPostgresQuery): Future[seq[string]] {.
    ...raises: [Exception, ValueError], tags: [RootEffect, WriteDirEffect,
    ReadDirEffect, ReadIOEffect, WriteIOEffect, TimeEffect].}
It is only used with raw()
proc get(self: PostgresQuery): Future[seq[JsonNode]] {.
    ...raises: [Exception, ValueError], tags: [RootEffect, WriteDirEffect,
    ReadDirEffect, ReadIOEffect, WriteIOEffect, TimeEffect].}
proc get(self: RawPostgresQuery): Future[seq[JsonNode]] {.
    ...raises: [Exception, ValueError], tags: [RootEffect, WriteDirEffect,
    ReadDirEffect, ReadIOEffect, WriteIOEffect, TimeEffect].}
It is only used with raw()
proc get[T](self: PostgresQuery; typ: typedesc[T]): Future[seq[T]]
proc getPlain(self: PostgresQuery): Future[seq[seq[string]]] {.
    ...raises: [Exception, ValueError], tags: [RootEffect, WriteDirEffect,
    ReadDirEffect, ReadIOEffect, WriteIOEffect, TimeEffect].}
proc getPlain(self: RawPostgresQuery): Future[seq[seq[string]]] {.
    ...raises: [Exception, ValueError], tags: [RootEffect, WriteDirEffect,
    ReadDirEffect, ReadIOEffect, WriteIOEffect, TimeEffect].}
It is only used with raw()
proc groupBy(self: PostgresQuery; column: string): PostgresQuery {.
    ...raises: [KeyError], tags: [].}
proc having(self: PostgresQuery; column: string; symbol: string;
            value: string | int | float | bool): PostgresQuery
proc having(self: PostgresQuery; column: string; symbol: string; value: nil.type): PostgresQuery {.
    ...raises: [Exception, KeyError], tags: [].}
proc insert(self: PostgresQuery; items: JsonNode): owned(Future[void]) {.
    ...raises: [Exception], tags: [RootEffect, WriteDirEffect, ReadDirEffect,
                                ReadIOEffect, WriteIOEffect, TimeEffect].}
items is JObject
proc insert(self: PostgresQuery; items: seq[JsonNode]): owned(Future[void]) {.
    ...raises: [Exception], tags: [RootEffect, WriteDirEffect, ReadDirEffect,
                                ReadIOEffect, WriteIOEffect, TimeEffect].}
proc insertId(self: PostgresQuery; items: JsonNode; key = "id"): Future[string] {.
    ...raises: [Exception, ValueError], tags: [RootEffect, WriteDirEffect,
    ReadDirEffect, ReadIOEffect, WriteIOEffect, TimeEffect].}
proc insertId(self: PostgresQuery; items: seq[JsonNode]; key = "id"): Future[
    seq[string]] {....raises: [Exception, ValueError], tags: [RootEffect,
    WriteDirEffect, ReadDirEffect, ReadIOEffect, WriteIOEffect, TimeEffect].}
proc join(self: PostgresQuery; table: string; column1: string; symbol: string;
          column2: string): PostgresQuery {....raises: [KeyError], tags: [].}
proc leftJoin(self: PostgresQuery; table: string; column1: string;
              symbol: string; column2: string): PostgresQuery {.
    ...raises: [KeyError], tags: [].}
proc limit(self: PostgresQuery; num: int): PostgresQuery {....raises: [], tags: [].}
proc max(self: PostgresQuery; column: string): Future[Option[string]] {.
    ...raises: [Exception, ValueError], tags: [RootEffect, WriteDirEffect,
    ReadDirEffect, ReadIOEffect, WriteIOEffect, TimeEffect].}
proc min(self: PostgresQuery; column: string): Future[Option[string]] {.
    ...raises: [Exception, ValueError], tags: [RootEffect, WriteDirEffect,
    ReadDirEffect, ReadIOEffect, WriteIOEffect, TimeEffect].}
proc offset(self: PostgresQuery; num: int): PostgresQuery {....raises: [], tags: [].}
proc orderBy(self: PostgresQuery; column: string; order: Order): PostgresQuery {.
    ...raises: [KeyError], tags: [].}
proc orWhere(self: PostgresQuery; column: string; symbol: string;
             value: string | int | float | bool): PostgresQuery
proc orWhere(self: PostgresQuery; column: string; symbol: string;
             value: nil.type): PostgresQuery {....raises: [Exception, KeyError],
    tags: [].}
proc rollback(self: PostgresConnections): owned(Future[void]) {.
    ...raises: [Exception], tags: [RootEffect, WriteDirEffect, ReadDirEffect,
                                ReadIOEffect, WriteIOEffect, TimeEffect].}
proc sum(self: PostgresQuery; column: string): Future[Option[float]] {.
    ...raises: [Exception, ValueError], tags: [RootEffect, WriteDirEffect,
    ReadDirEffect, ReadIOEffect, WriteIOEffect, TimeEffect].}
proc table(self: PostgresQuery; tableArg: string): PostgresQuery {....raises: [],
    tags: [].}
proc update(self: PostgresQuery; items: JsonNode): owned(Future[void]) {.
    ...raises: [Exception], tags: [RootEffect, WriteDirEffect, ReadDirEffect,
                                ReadIOEffect, WriteIOEffect, TimeEffect].}
proc where(self: PostgresQuery; column: string; symbol: string;
           value: string | int | float): PostgresQuery
proc where(self: PostgresQuery; column: string; symbol: string; value: bool): PostgresQuery {.
    ...raises: [Exception, KeyError], tags: [].}
proc where(self: PostgresQuery; column: string; symbol: string; value: nil.type): PostgresQuery {.
    ...raises: [Exception, KeyError], tags: [].}
proc whereBetween(self: PostgresQuery; column: string;
                  width: array[2, int | float]): PostgresQuery
proc whereBetween(self: PostgresQuery; column: string; width: array[2, string]): PostgresQuery {.
    ...raises: [KeyError], tags: [].}
proc whereIn(self: PostgresQuery; column: string;
             width: seq[int | float | string]): PostgresQuery
proc whereNotBetween(self: PostgresQuery; column: string;
                     width: array[2, int | float]): PostgresQuery
proc whereNotBetween(self: PostgresQuery; column: string;
                     width: array[2, string]): PostgresQuery {.
    ...raises: [KeyError], tags: [].}
proc whereNotIn(self: PostgresQuery; column: string;
                width: seq[int | float | string]): PostgresQuery
proc whereNull(self: PostgresQuery; column: string): PostgresQuery {.
    ...raises: [KeyError], tags: [].}

Templates

template seeder(rdb: PostgresConnections; tableName, column: string;
                body: untyped): untyped
The seeder block allows the code in the block to work only when the table or specified column is empty.
template seeder(rdb: PostgresConnections; tableName: string; body: untyped): untyped
The seeder block allows the code in the block to work only when the table is empty.