fix compile

This commit is contained in:
GroovieGermanikus 2024-02-27 21:08:30 +01:00
parent 4bee01aa82
commit c9a95a1d25
No known key found for this signature in database
GPG Key ID: 5B6EB831A5CD2015
1 changed files with 3 additions and 6 deletions

View File

@ -190,21 +190,18 @@ impl PostgresSession {
const TEMP_TABLESPACE: &str = "mango_tempspace";
let tablespace_exists =
self.client
.query_opt("SELECT spcname FROM pg_tablespace WHERE spcname=$1", &[TEMP_TABLESPACE])
.query_opt("SELECT spcname FROM pg_tablespace WHERE spcname=$1", &[&TEMP_TABLESPACE])
.await
.unwrap().is_some();
if tablespace_exists {
info!("Tablespace {} already exists - use it for temp tables", TEMP_TABLESPACE);
info!("Tablespace {} exists - use it for temp tables", TEMP_TABLESPACE);
self.client
.execute("SET temp_tablespaces=$1", &[TEMP_TABLESPACE])
.execute("SET temp_tablespaces=$1", &[&TEMP_TABLESPACE])
.await
.unwrap();
}
}
SELECT spcname FROM pg_tablespace;
pub async fn drop_temp_table(&self, table: String) -> anyhow::Result<()> {
self.client
.execute(format!("drop table if exists {};", table).as_str(), &[])