Skip to content

Conversation

imor
Copy link
Contributor

@imor imor commented Aug 31, 2025

This PR bumpgs pgrx to the latest release version 0.16.0. Had to update some code to make the code compile. Also fixed some clippy warnings.

/// GraphQL field and argument name constants used throughout the codebase
///
/// This module centralizes all magic strings to prevent typos and make refactoring easier.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed clippy warning due to extra line in docs.

pub const SET: &str = "set";
pub const AT_MOST: &str = "atMost";
pub const AT: &str = "at";
pub const DELETE_USING_NODE_ID: &str = "deleteUsingNodeId";
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed clippy warning about unused consts.

pub struct SchemaType {
pub schema: Arc<__Schema>,
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed clippy warning about unused type.


use pgrx::prelude::*;

let spi_result: GraphQLResult<serde_json::Value> = Spi::connect(|mut conn| {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had to change the method being called to get a mutable reference to conn to make the code compile.

pub(crate) fn get_one_readonly<A: FromDatum + IntoDatum>(
query: &str,
) -> std::result::Result<Option<A>, pgrx::spi::Error> {
Spi::connect(|client| client.select(query, Some(1), None)?.first().get_one())
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Signature changed in latest pgrx version.

self.params.push(datum_with_oid);
Ok(format!("(${}::{})", self.params.len(), type_name))
}
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All changes in this file are due to changes in signature of method in latest pgrx version.

@imor imor merged commit c8a38d5 into master Sep 1, 2025
14 checks passed
@imor imor deleted the rs/bumpg-pgrx branch September 1, 2025 04:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants