MCPcopy
hub / github.com/jackc/pgx / Queue

Method Queue

batch.go:75–82  ·  view source on GitHub ↗

Queue queues a query to batch b. query can be an SQL query or the name of a prepared statement. The only pgx option argument that is supported is [QueryRewriter]. Queries are executed using the connection's DefaultQueryExecMode (see [ConnConfig.DefaultQueryExecMode]). While query can contain multip

(query string, arguments ...any)

Source from the content-addressed store, hash-verified

73// [QueuedQuery.Query], [QueuedQuery.QueryRow], and [QueuedQuery.Exec] must not be called. In addition, any error
74// messages or tracing that include the current query may reference the wrong query.
75func (b *Batch) Queue(query string, arguments ...any) *QueuedQuery {
76 qq := &QueuedQuery{
77 SQL: query,
78 Arguments: arguments,
79 }
80 b.QueuedQueries = append(b.QueuedQueries, qq)
81 return qq
82}
83
84// Len returns number of queries that have been queued so far.
85func (b *Batch) Len() int {

Calls

no outgoing calls