We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents fc10985 + 558c169 commit 21e4dd7Copy full SHA for 21e4dd7
tokio-postgres/src/client.rs
@@ -113,6 +113,10 @@ impl InnerClient {
113
self.state.lock().types.insert(oid, type_.clone());
114
}
115
116
+ pub fn clear_types(&self) {
117
+ self.state.lock().types.clear();
118
+ }
119
+
120
pub fn with_buf<F, R>(&self, f: F) -> R
121
where
122
F: FnOnce(&mut BytesMut) -> R,
@@ -176,6 +180,11 @@ impl Client {
176
180
&self.inner
177
181
178
182
183
+ /// Clears the cache of database types (domain, enum, composition) that are loaded when preparing a query.
184
+ pub fn clear_types_cache(&self) {
185
+ self.inner().clear_types()
186
187
179
188
#[cfg(feature = "runtime")]
189
pub(crate) fn set_socket_config(&mut self, socket_config: SocketConfig) {
190
self.socket_config = Some(socket_config);
0 commit comments