Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 37bce3ce61 | |||
| ab4df37fd0 | |||
| 3414a32bd6 | |||
| 06432cf0f5 |
@ -77,8 +77,8 @@ impl DatabaseExecutor for SpiExecutor {
|
|||||||
|
|
||||||
pgrx::debug1!("JSPG_SQL: {}", sql);
|
pgrx::debug1!("JSPG_SQL: {}", sql);
|
||||||
self.transact(|| {
|
self.transact(|| {
|
||||||
Spi::connect(|client| {
|
Spi::connect_mut(|client| {
|
||||||
match client.select(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) {
|
||||||
Ok(tup_table) => {
|
Ok(tup_table) => {
|
||||||
let mut results = Vec::new();
|
let mut results = Vec::new();
|
||||||
for row in tup_table {
|
for row in tup_table {
|
||||||
|
|||||||
@ -57,7 +57,7 @@ pub fn jspg_setup(database: Json) -> Json {
|
|||||||
Json(serde_json::to_value(drop).unwrap())
|
Json(serde_json::to_value(drop).unwrap())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg_attr(not(test), pg_extern)]
|
#[cfg_attr(not(test), pg_extern(volatile))]
|
||||||
pub fn jspg_merge(schema_id: &str, data: JsonB) -> JsonB {
|
pub fn jspg_merge(schema_id: &str, data: JsonB) -> JsonB {
|
||||||
// Try to acquire a read lock to get a clone of the Engine Arc
|
// Try to acquire a read lock to get a clone of the Engine Arc
|
||||||
let engine_opt = {
|
let engine_opt = {
|
||||||
@ -74,7 +74,7 @@ pub fn jspg_merge(schema_id: &str, data: JsonB) -> JsonB {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg_attr(not(test), pg_extern)]
|
#[cfg_attr(not(test), pg_extern(volatile))]
|
||||||
pub fn jspg_merge_ordered(schema_id: &str, data: Json) -> Json {
|
pub fn jspg_merge_ordered(schema_id: &str, data: Json) -> Json {
|
||||||
let engine_opt = {
|
let engine_opt = {
|
||||||
let lock = GLOBAL_JSPG.read().unwrap();
|
let lock = GLOBAL_JSPG.read().unwrap();
|
||||||
|
|||||||
Reference in New Issue
Block a user