Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ebb97b3509 | |||
| 5d18847f32 |
@ -24,6 +24,7 @@ impl DatabaseExecutor for SpiExecutor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pgrx::PgTryBuilder::new(|| {
|
||||||
Spi::connect(|client| {
|
Spi::connect(|client| {
|
||||||
pgrx::notice!("JSPG_SQL: {}", sql);
|
pgrx::notice!("JSPG_SQL: {}", sql);
|
||||||
match client.select(sql, Some(args_with_oid.len() as i64), &args_with_oid) {
|
match client.select(sql, Some(args_with_oid.len() as i64), &args_with_oid) {
|
||||||
@ -39,6 +40,12 @@ impl DatabaseExecutor for SpiExecutor {
|
|||||||
Err(e) => Err(format!("SPI Query Fetch Failure: {}", e)),
|
Err(e) => Err(format!("SPI Query Fetch Failure: {}", e)),
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
})
|
||||||
|
.catch_others(|cause| {
|
||||||
|
pgrx::warning!("JSPG Caught Native Postgres Error: {:?}", cause);
|
||||||
|
Err(format!("{:?}", cause))
|
||||||
|
})
|
||||||
|
.execute()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn execute(&self, sql: &str, args: Option<&[Value]>) -> Result<(), String> {
|
fn execute(&self, sql: &str, args: Option<&[Value]>) -> Result<(), String> {
|
||||||
@ -53,6 +60,7 @@ impl DatabaseExecutor for SpiExecutor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pgrx::PgTryBuilder::new(|| {
|
||||||
Spi::connect_mut(|client| {
|
Spi::connect_mut(|client| {
|
||||||
pgrx::notice!("JSPG_SQL: {}", sql);
|
pgrx::notice!("JSPG_SQL: {}", sql);
|
||||||
match client.update(sql, Some(args_with_oid.len() as i64), &args_with_oid) {
|
match client.update(sql, Some(args_with_oid.len() as i64), &args_with_oid) {
|
||||||
@ -60,6 +68,12 @@ impl DatabaseExecutor for SpiExecutor {
|
|||||||
Err(e) => Err(format!("SPI Execution Failure: {}", e)),
|
Err(e) => Err(format!("SPI Execution Failure: {}", e)),
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
})
|
||||||
|
.catch_others(|cause| {
|
||||||
|
pgrx::warning!("JSPG Caught Native Postgres Error: {:?}", cause);
|
||||||
|
Err(format!("{:?}", cause))
|
||||||
|
})
|
||||||
|
.execute()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn auth_user_id(&self) -> Result<String, String> {
|
fn auth_user_id(&self) -> Result<String, String> {
|
||||||
|
|||||||
Reference in New Issue
Block a user