# src/allographer/query_builder/models/mysql/mysql_exec

Theme:

- Index

Search:
Group by:

# Imports

../../libs/mysql/mysql_impl, ../../log, ../database_types, query/mysql_builder, mysql_types

# Procs

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

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

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

  get columns sequence from table

    proc commit(self: MysqlConnections): owned(Future[void]) {....stackTrace: false,
        raises: [Exception, OSError, IOError, ValueError, KeyError, DbError], tags: [
        RootEffect, WriteDirEffect, ReadDirEffect, ReadIOEffect, WriteIOEffect],
        forbids: [].}

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

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

    proc delete(self: MysqlQuery; id: int; key = "id"): owned(Future[void]) {.
        ...stackTrace: false,
        raises: [Exception, KeyError, OSError, IOError, ValueError, DbError], tags: [
        RootEffect, WriteDirEffect, ReadDirEffect, ReadIOEffect, WriteIOEffect,
        TimeEffect], forbids: [].}

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

  It is only used with raw()

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

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

    proc findPlain(self: MysqlQuery; id: int; key = "id"): Future[seq[string]] {.
        ...stackTrace: false,
        raises: [Exception, ValueError, KeyError, IOError, OSError], tags: [
        RootEffect, WriteDirEffect, ReadDirEffect, ReadIOEffect, WriteIOEffect,
        TimeEffect], forbids: [].}

    proc findPlain(self: MysqlQuery; id: string; key = "id"): Future[seq[string]] {.
        ...stackTrace: false,
        raises: [Exception, ValueError, KeyError, IOError, OSError], tags: [
        RootEffect, WriteDirEffect, ReadDirEffect, ReadIOEffect, WriteIOEffect,
        TimeEffect], forbids: [].}

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

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

  It is only used with raw()

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

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

  It is only used with raw()

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

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

  It is only used with raw()

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

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

  It is only used with raw()

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

  items is `JObject`

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

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

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

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

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

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

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

    proc max(self: MysqlQuery; column: string): Future[Option[string]] {.
        ...stackTrace: false, raises: [Exception, ValueError, KeyError, OSError,
                                    IOError, DbError, JsonParsingError], tags: [
        RootEffect, WriteDirEffect, ReadDirEffect, ReadIOEffect, WriteIOEffect,
        TimeEffect], forbids: [].}

    proc min(self: MysqlQuery; column: string): Future[Option[string]] {.
        ...stackTrace: false, raises: [Exception, ValueError, KeyError, OSError,
                                    IOError, DbError, JsonParsingError], tags: [
        RootEffect, WriteDirEffect, ReadDirEffect, ReadIOEffect, WriteIOEffect,
        TimeEffect], forbids: [].}

    proc rollback(self: MysqlConnections): owned(Future[void]) {....stackTrace: false,
        raises: [Exception, OSError, IOError, ValueError, KeyError, DbError], tags: [
        RootEffect, WriteDirEffect, ReadDirEffect, ReadIOEffect, WriteIOEffect],
        forbids: [].}

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

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

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

# Templates

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

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