# src/allographer/query_builder/models/surreal/surreal_exec

Theme:

- Index

Search:
Group by:

# Imports

../../libs/surreal/surreal_lib, ../../libs/surreal/surreal_impl, ../../log, ../../enums, ../database_types, query/surreal_builder, surreal_types, surreal_query

# Procs

    proc avg(self: SurrealQuery; column: string): Future[float] {....stackTrace: false, raises: [
        Exception, ValueError, KeyError, OSError, IOError, DbError,
        HttpRequestError, LibraryError, SslError, ProtocolError], tags: [RootEffect,
        WriteDirEffect, ReadDirEffect, ReadIOEffect, WriteIOEffect, TimeEffect],
        forbids: [].}

    proc columns(self: SurrealQuery): Future[seq[string]] {....stackTrace: false,
        raises: [Exception, ValueError, KeyError, IOError, OSError], tags: [
        RootEffect, WriteDirEffect, ReadDirEffect, ReadIOEffect, WriteIOEffect,
        TimeEffect], forbids: [].}

    proc count(self: SurrealQuery): Future[int] {....stackTrace: false, raises: [
        Exception, ValueError, KeyError, OSError, IOError, DbError,
        HttpRequestError, LibraryError, SslError, ProtocolError], tags: [RootEffect,
        WriteDirEffect, ReadDirEffect, ReadIOEffect, WriteIOEffect, TimeEffect],
        forbids: [].}

    proc delete(self: SurrealQuery): owned(Future[void]) {....stackTrace: false, raises: [
        Exception, KeyError, OSError, IOError, ValueError, DbError,
        HttpRequestError, LibraryError, SslError, ProtocolError], tags: [RootEffect,
        WriteDirEffect, ReadDirEffect, ReadIOEffect, WriteIOEffect, TimeEffect],
        forbids: [].}

  https://surrealdb.com/docs/surrealql/statements/delete

    proc delete(self: SurrealQuery; id: SurrealId): owned(Future[void]) {.
        ...stackTrace: false, raises: [Exception, OSError, IOError, ValueError,
                                    DbError, HttpRequestError, LibraryError,
                                    SslError, ProtocolError, KeyError], tags: [
        RootEffect, WriteDirEffect, ReadDirEffect, ReadIOEffect, WriteIOEffect,
        TimeEffect], forbids: [].}

  https://surrealdb.com/docs/surrealql/statements/delete

    proc exec(self: RawSurrealQuery): owned(Future[void]) {....stackTrace: false,
        raises: [Exception, IOError, OSError], tags: [RootEffect, WriteDirEffect,
        ReadDirEffect, ReadIOEffect, WriteIOEffect, TimeEffect], forbids: [].}

  It is only used with raw()

  https://surrealdb.com/docs/integration/http#sql

  https://surrealdb.com/docs/surrealql

    proc find(self: SurrealQuery; id: SurrealId; key = "id"): Future[
        Option[JsonNode]] {....stackTrace: false, raises: [Exception, ValueError,
        KeyError, IOError, OSError], tags: [RootEffect, WriteDirEffect,
                                            ReadDirEffect, ReadIOEffect,
                                            WriteIOEffect, TimeEffect], forbids: [].}

    proc first(self: RawSurrealQuery): Future[Option[JsonNode]] {....stackTrace: false, raises: [
        Exception, ValueError, OSError, IOError, DbError, HttpRequestError,
        LibraryError, SslError, ProtocolError, KeyError], tags: [RootEffect,
        WriteDirEffect, ReadDirEffect, ReadIOEffect, WriteIOEffect, TimeEffect],
        forbids: [].}

  It is only used with raw()

    proc first(self: SurrealQuery): Future[Option[JsonNode]] {....stackTrace: false,
        raises: [Exception, ValueError, KeyError, IOError, OSError], tags: [
        RootEffect, WriteDirEffect, ReadDirEffect, ReadIOEffect, WriteIOEffect,
        TimeEffect], forbids: [].}

    proc get(self: RawSurrealQuery): Future[seq[JsonNode]] {....stackTrace: false, raises: [
        Exception, ValueError, OSError, IOError, DbError, HttpRequestError,
        LibraryError, SslError, ProtocolError, KeyError], tags: [RootEffect,
        WriteDirEffect, ReadDirEffect, ReadIOEffect, WriteIOEffect, TimeEffect],
        forbids: [].}

  It is only used with raw()

    proc get(self: SurrealQuery): Future[seq[JsonNode]] {....stackTrace: false,
        raises: [Exception, ValueError, KeyError, IOError, OSError], tags: [
        RootEffect, WriteDirEffect, ReadDirEffect, ReadIOEffect, WriteIOEffect,
        TimeEffect], forbids: [].}

  https://surrealdb.com/docs/surrealql/statements/select

    proc info(self: RawSurrealQuery): Future[JsonNode] {....stackTrace: false,
        raises: [Exception, ValueError, IOError, OSError], tags: [RootEffect,
        WriteDirEffect, ReadDirEffect, ReadIOEffect, WriteIOEffect, TimeEffect],
        forbids: [].}

  Get all response.

  https://surrealdb.com/docs/integration/http#sql

  https://surrealdb.com/docs/surrealql

    proc insert(self: SurrealQuery; items: JsonNode): owned(Future[void]) {.
        ...stackTrace: false, raises: [Exception, KeyError, OSError, IOError,
                                    ValueError, DbError, HttpRequestError,
                                    LibraryError, SslError, ProtocolError], tags: [
        RootEffect, WriteDirEffect, ReadDirEffect, ReadIOEffect, WriteIOEffect,
        TimeEffect], forbids: [].}

  https://surrealdb.com/docs/surrealql/statements/insert

    proc insert(self: SurrealQuery; items: seq[JsonNode]): owned(Future[void]) {.
        ...stackTrace: false, raises: [Exception, KeyError, OSError, IOError,
                                    ValueError, DbError, HttpRequestError,
                                    LibraryError, SslError, ProtocolError], tags: [
        RootEffect, WriteDirEffect, ReadDirEffect, ReadIOEffect, WriteIOEffect,
        TimeEffect], forbids: [].}

  https://surrealdb.com/docs/surrealql/statements/insert

    proc insert[T](self: SurrealQuery; items: seq[T]): owned(Future[void]) {.
        ...stackTrace: false.}

  https://surrealdb.com/docs/surrealql/statements/insert

    proc insert[T](self: SurrealQuery; items: T): owned(Future[void]) {.
        ...stackTrace: false.}

  https://surrealdb.com/docs/surrealql/statements/insert

    proc insertId(self: SurrealQuery; items: JsonNode; key = "id"): Future[SurrealId] {.
        ...stackTrace: false, raises: [Exception, ValueError, KeyError, OSError,
                                    IOError, DbError, HttpRequestError,
                                    LibraryError, SslError, ProtocolError], tags: [
        RootEffect, WriteDirEffect, ReadDirEffect, ReadIOEffect, WriteIOEffect,
        TimeEffect], forbids: [].}

  https://surrealdb.com/docs/surrealql/statements/insert

    proc insertId(self: SurrealQuery; items: seq[JsonNode]; key = "id"): Future[
        seq[SurrealId]] {....stackTrace: false, raises: [Exception, ValueError,
        KeyError, OSError, IOError, DbError, HttpRequestError, LibraryError,
        SslError, ProtocolError], tags: [RootEffect, WriteDirEffect, ReadDirEffect,
                                         ReadIOEffect, WriteIOEffect, TimeEffect],
                          forbids: [].}

    proc insertId[T](self: SurrealQuery; items: seq[T]; key = "id"): Future[
        seq[SurrealId]] {....stackTrace: false.}

    proc insertId[T](self: SurrealQuery; items: T; key = "id"): Future[SurrealId] {.
        ...stackTrace: false.}

  https://surrealdb.com/docs/surrealql/statements/insert

    proc max(self: SurrealQuery; column: string; collaction: Collation = None): Future[
        string] {....stackTrace: false, raises: [Exception, ValueError, KeyError,
        OSError, IOError, DbError, HttpRequestError, LibraryError, SslError,
        ProtocolError], tags: [RootEffect, WriteDirEffect, ReadDirEffect,
                               ReadIOEffect, WriteIOEffect, TimeEffect], forbids: [].}

  = `ORDER BY {column} {collaction} DESC LIMIT 1`

    proc min(self: SurrealQuery; column: string; collaction: Collation = None): Future[
        string] {....stackTrace: false, raises: [Exception, ValueError, KeyError,
        OSError, IOError, DbError, HttpRequestError, LibraryError, SslError,
        ProtocolError], tags: [RootEffect, WriteDirEffect, ReadDirEffect,
                               ReadIOEffect, WriteIOEffect, TimeEffect], forbids: [].}

  = `ORDER BY {column} {collaction} ASC LIMIT 1`

    proc sum(self: SurrealQuery; column: string): Future[float] {....stackTrace: false, raises: [
        Exception, ValueError, KeyError, OSError, IOError, DbError,
        HttpRequestError, LibraryError, SslError, ProtocolError], tags: [RootEffect,
        WriteDirEffect, ReadDirEffect, ReadIOEffect, WriteIOEffect, TimeEffect],
        forbids: [].}

    proc update(self: SurrealConnections; id: SurrealId; items: JsonNode): owned(
        Future[void]) {....stackTrace: false, raises: [Exception, KeyError, OSError,
        IOError, ValueError, DbError, HttpRequestError, LibraryError, SslError,
        ProtocolError], tags: [RootEffect, WriteDirEffect, ReadDirEffect,
                               ReadIOEffect, WriteIOEffect, TimeEffect], forbids: [].}

  https://surrealdb.com/docs/surrealql/statements/update

    proc update(self: SurrealQuery; items: JsonNode): owned(Future[void]) {.
        ...stackTrace: false, raises: [Exception, KeyError, OSError, IOError,
                                    ValueError, DbError, HttpRequestError,
                                    LibraryError, SslError, ProtocolError], tags: [
        RootEffect, WriteDirEffect, ReadDirEffect, ReadIOEffect, WriteIOEffect,
        TimeEffect], forbids: [].}

  https://surrealdb.com/docs/surrealql/statements/update

    proc update[T](self: SurrealConnections; id: SurrealId; items: T): owned(
        Future[void]) {....stackTrace: false.}

  https://surrealdb.com/docs/surrealql/statements/update

    proc update[T](self: SurrealQuery; items: T): owned(Future[void]) {.
        ...stackTrace: false.}

  https://surrealdb.com/docs/surrealql/statements/update

# Templates

    template seeder(rdb: SurrealConnections; 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: SurrealConnections; tableName: string; body: untyped): untyped

  The `seeder` block allows the code in the block to work only when the table is empty.