Compare commits

..

2 Commits

2 changed files with 27 additions and 31 deletions

View File

@ -152,44 +152,40 @@ impl DatabaseExecutor for SpiExecutor {
}
fn auth_origin(&self) -> Result<Option<Value>, String> {
self.transact(|| {
Spi::connect(|client| {
let mut tup_table = client
.select(
"SELECT NULLIF(current_setting('auth.origin', true), '')::jsonb",
None,
&[],
)
.map_err(|e| format!("SPI Select Error: {}", e))?;
Spi::connect(|client| {
let mut tup_table = client
.select(
"SELECT NULLIF(current_setting('auth.origin', true), '')::jsonb",
None,
&[],
)
.map_err(|e| format!("SPI Select Error: {}", e))?;
if let Some(row) = tup_table.next() {
if let Ok(Some(jsonb)) = row.get::<pgrx::JsonB>(1) {
return Ok(Some(jsonb.0));
}
if let Some(row) = tup_table.next() {
if let Ok(Some(jsonb)) = row.get::<pgrx::JsonB>(1) {
return Ok(Some(jsonb.0));
}
Ok(None)
})
}
Ok(None)
})
}
fn punc_trigger(&self) -> Result<Option<String>, String> {
self.transact(|| {
Spi::connect(|client| {
let mut tup_table = client
.select(
"SELECT NULLIF(current_setting('punc.name', true), '')",
None,
&[],
)
.map_err(|e| format!("SPI Select Error: {}", e))?;
Spi::connect(|client| {
let mut tup_table = client
.select(
"SELECT NULLIF(current_setting('punc.name', true), '')",
None,
&[],
)
.map_err(|e| format!("SPI Select Error: {}", e))?;
if let Some(row) = tup_table.next() {
if let Ok(val_opt) = row.get::<String>(1) {
return Ok(val_opt);
}
if let Some(row) = tup_table.next() {
if let Ok(val_opt) = row.get::<String>(1) {
return Ok(val_opt);
}
Ok(None)
})
}
Ok(None)
})
}
}

View File

@ -1 +1 @@
1.0.153
1.0.154