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

Method Deallocate

conn.go:375–394  ·  view source on GitHub ↗

Deallocate releases a prepared statement. Calling Deallocate on a non-existent prepared statement will succeed.

(ctx context.Context, name string)

Source from the content-addressed store, hash-verified

373
374// Deallocate releases a prepared statement. Calling Deallocate on a non-existent prepared statement will succeed.
375func (c *Conn) Deallocate(ctx context.Context, name string) error {
376 var psName string
377 sd := c.preparedStatements[name]
378 if sd != nil {
379 psName = sd.Name
380 } else {
381 psName = name
382 }
383
384 err := c.pgConn.Deallocate(ctx, psName)
385 if err != nil {
386 return err
387 }
388
389 if sd != nil {
390 delete(c.preparedStatements, name)
391 }
392
393 return nil
394}
395
396// DeallocateAll releases all previously prepared statements from the server and client, where it also resets the statement and description cache.
397func (c *Conn) DeallocateAll(ctx context.Context) error {

Calls

no outgoing calls