summaryrefslogtreecommitdiff
path: root/vendor/github.com/jackc/pgx/v5/internal/stmtcache
diff options
context:
space:
mode:
authorLibravatar dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>2024-02-19 11:20:15 +0100
committerLibravatar GitHub <noreply@github.com>2024-02-19 11:20:15 +0100
commite2ebcbb5167ba487f4ff7697df298fc74836c801 (patch)
treeb5e3bd3c7262f2497de281faecbd3874f06a5caa /vendor/github.com/jackc/pgx/v5/internal/stmtcache
parent[feature] Add Mastodon-compatible HTTP signature fallback (#2659) (diff)
downloadgotosocial-e2ebcbb5167ba487f4ff7697df298fc74836c801.tar.xz
[chore]: Bump github.com/jackc/pgx/v5 from 5.5.2 to 5.5.3 (#2664)
Bumps [github.com/jackc/pgx/v5](https://github.com/jackc/pgx) from 5.5.2 to 5.5.3. - [Changelog](https://github.com/jackc/pgx/blob/master/CHANGELOG.md) - [Commits](https://github.com/jackc/pgx/compare/v5.5.2...v5.5.3) --- updated-dependencies: - dependency-name: github.com/jackc/pgx/v5 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Diffstat (limited to 'vendor/github.com/jackc/pgx/v5/internal/stmtcache')
-rw-r--r--vendor/github.com/jackc/pgx/v5/internal/stmtcache/lru_cache.go14
-rw-r--r--vendor/github.com/jackc/pgx/v5/internal/stmtcache/stmtcache.go9
-rw-r--r--vendor/github.com/jackc/pgx/v5/internal/stmtcache/unlimited_cache.go12
3 files changed, 25 insertions, 10 deletions
diff --git a/vendor/github.com/jackc/pgx/v5/internal/stmtcache/lru_cache.go b/vendor/github.com/jackc/pgx/v5/internal/stmtcache/lru_cache.go
index 859345fcb..dec83f47b 100644
--- a/vendor/github.com/jackc/pgx/v5/internal/stmtcache/lru_cache.go
+++ b/vendor/github.com/jackc/pgx/v5/internal/stmtcache/lru_cache.go
@@ -81,12 +81,16 @@ func (c *LRUCache) InvalidateAll() {
c.l = list.New()
}
-// HandleInvalidated returns a slice of all statement descriptions invalidated since the last call to HandleInvalidated.
-// Typically, the caller will then deallocate them.
-func (c *LRUCache) HandleInvalidated() []*pgconn.StatementDescription {
- invalidStmts := c.invalidStmts
+// GetInvalidated returns a slice of all statement descriptions invalidated since the last call to RemoveInvalidated.
+func (c *LRUCache) GetInvalidated() []*pgconn.StatementDescription {
+ return c.invalidStmts
+}
+
+// RemoveInvalidated removes all invalidated statement descriptions. No other calls to Cache must be made between a
+// call to GetInvalidated and RemoveInvalidated or RemoveInvalidated may remove statement descriptions that were
+// never seen by the call to GetInvalidated.
+func (c *LRUCache) RemoveInvalidated() {
c.invalidStmts = nil
- return invalidStmts
}
// Len returns the number of cached prepared statement descriptions.
diff --git a/vendor/github.com/jackc/pgx/v5/internal/stmtcache/stmtcache.go b/vendor/github.com/jackc/pgx/v5/internal/stmtcache/stmtcache.go
index b2940e230..d57bdd29e 100644
--- a/vendor/github.com/jackc/pgx/v5/internal/stmtcache/stmtcache.go
+++ b/vendor/github.com/jackc/pgx/v5/internal/stmtcache/stmtcache.go
@@ -29,8 +29,13 @@ type Cache interface {
// InvalidateAll invalidates all statement descriptions.
InvalidateAll()
- // HandleInvalidated returns a slice of all statement descriptions invalidated since the last call to HandleInvalidated.
- HandleInvalidated() []*pgconn.StatementDescription
+ // GetInvalidated returns a slice of all statement descriptions invalidated since the last call to RemoveInvalidated.
+ GetInvalidated() []*pgconn.StatementDescription
+
+ // RemoveInvalidated removes all invalidated statement descriptions. No other calls to Cache must be made between a
+ // call to GetInvalidated and RemoveInvalidated or RemoveInvalidated may remove statement descriptions that were
+ // never seen by the call to GetInvalidated.
+ RemoveInvalidated()
// Len returns the number of cached prepared statement descriptions.
Len() int
diff --git a/vendor/github.com/jackc/pgx/v5/internal/stmtcache/unlimited_cache.go b/vendor/github.com/jackc/pgx/v5/internal/stmtcache/unlimited_cache.go
index f5f59396e..696413291 100644
--- a/vendor/github.com/jackc/pgx/v5/internal/stmtcache/unlimited_cache.go
+++ b/vendor/github.com/jackc/pgx/v5/internal/stmtcache/unlimited_cache.go
@@ -54,10 +54,16 @@ func (c *UnlimitedCache) InvalidateAll() {
c.m = make(map[string]*pgconn.StatementDescription)
}
-func (c *UnlimitedCache) HandleInvalidated() []*pgconn.StatementDescription {
- invalidStmts := c.invalidStmts
+// GetInvalidated returns a slice of all statement descriptions invalidated since the last call to RemoveInvalidated.
+func (c *UnlimitedCache) GetInvalidated() []*pgconn.StatementDescription {
+ return c.invalidStmts
+}
+
+// RemoveInvalidated removes all invalidated statement descriptions. No other calls to Cache must be made between a
+// call to GetInvalidated and RemoveInvalidated or RemoveInvalidated may remove statement descriptions that were
+// never seen by the call to GetInvalidated.
+func (c *UnlimitedCache) RemoveInvalidated() {
c.invalidStmts = nil
- return invalidStmts
}
// Len returns the number of cached prepared statement descriptions.