DeallocateAll releases all previously prepared statements from the server and client, where it also resets the statement and description cache.
(ctx context.Context)
| 395 | |
| 396 | // DeallocateAll releases all previously prepared statements from the server and client, where it also resets the statement and description cache. |
| 397 | func (c *Conn) DeallocateAll(ctx context.Context) error { |
| 398 | c.preparedStatements = map[string]*pgconn.StatementDescription{} |
| 399 | if c.config.StatementCacheCapacity > 0 { |
| 400 | c.statementCache = stmtcache.NewLRUCache(c.config.StatementCacheCapacity) |
| 401 | } |
| 402 | if c.config.DescriptionCacheCapacity > 0 { |
| 403 | c.descriptionCache = stmtcache.NewLRUCache(c.config.DescriptionCacheCapacity) |
| 404 | } |
| 405 | _, err := c.pgConn.Exec(ctx, "deallocate all").ReadAll() |
| 406 | return err |
| 407 | } |
| 408 | |
| 409 | func (c *Conn) bufferNotifications(_ *pgconn.PgConn, n *pgconn.Notification) { |
| 410 | c.notifications = append(c.notifications, n) |