exec overloads: extended-query single-statement execution that ignores result rows and returns just the command tag (CommandResult).
Procs
proc exec(conn: PgConnection; sql: string; params: seq[PgParam] = @[]; timeout: Duration = ZeroDuration): Future[CommandResult] {. ...stackTrace: false, raises: [Exception, ValueError, CatchableError], tags: [RootEffect, TimeEffect], forbids: [].}
-
Execute a statement with typed parameters via the extended query protocol.
Single statement only; the plan is cached per-connection. Use simpleExec for parameter-less session commands (BEGIN, SET, VACUUM, LISTEN …) or simpleQuery when you need multi-statement execution in one round trip.
On timeout the connection is marked closed (protocol desync) and cannot be reused; pooled connections are discarded automatically.
proc exec(conn: PgConnection; sql: string; params: seq[PgParamInline]; timeout: Duration = ZeroDuration): Future[CommandResult] {. ...stackTrace: false, raises: [Exception, ValueError, CatchableError], tags: [RootEffect, TimeEffect], forbids: [].}
- Execute a statement with heap-alloc-free inline parameters. Prefer this overload for scalar-heavy workloads (e.g. bulk INSERT of numeric columns) where seq[PgParam] would heap-allocate per parameter.
proc execImpl(conn: PgConnection; sql: string; params: seq[Option[seq[byte]]]; paramOids: seq[int32]; paramFormats: seq[int16]; timeout: Duration = ZeroDuration): Future[string] {. ...stackTrace: false, raises: [Exception, ValueError, PgConnectionError, ProtocolError, KeyError, SslError, PgQueryError, AsyncTimeoutError, CatchableError], tags: [RootEffect, TimeEffect], forbids: [].}
proc execImpl(conn: PgConnection; sql: string; params: seq[PgParam] = @[]; timeout: Duration = ZeroDuration): Future[string] {. ...stackTrace: false, raises: [Exception, ValueError, PgConnectionError, ProtocolError, KeyError, SslError, PgQueryError, AsyncTimeoutError, CatchableError], tags: [RootEffect, TimeEffect], forbids: [].}
proc execInlineImpl(conn: PgConnection; sql: string; data: seq[byte]; ranges: seq[tuple[off: int32, len: int32]]; paramOids: seq[int32]; paramFormats: seq[int16]; timeout: Duration = ZeroDuration): Future[string] {. ...stackTrace: false, raises: [Exception, ValueError, PgConnectionError, ProtocolError, KeyError, SslError, PgQueryError, AsyncTimeoutError, CatchableError], tags: [RootEffect, TimeEffect], forbids: [].}
proc notify(conn: PgConnection; channel: string; payload: string = ""; timeout: Duration = ZeroDuration): Future[void] {....stackTrace: false, raises: [Exception, ValueError, CatchableError], tags: [RootEffect, TimeEffect], forbids: [].}
- Send a NOTIFY on channel with optional payload. Uses NOTIFY for empty payloads, pg_notify() otherwise.