Skip to content

Commit

Permalink
flip-flop on deprecatedness
Browse files Browse the repository at this point in the history
  • Loading branch information
workingjubilee authored Sep 6, 2024
1 parent 571d7aa commit bc10a92
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 10 deletions.
7 changes: 0 additions & 7 deletions pgrx-tests/src/tests/spi_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ mod tests {
}

#[pg_test]
#[allow(deprecated)]
fn test_cursor() -> Result<(), spi::Error> {
Spi::connect(|mut client| {
client.update("CREATE TABLE tests.cursor_table (id int)", None, None)?;
Expand All @@ -224,7 +223,6 @@ mod tests {
}

#[pg_test]
#[allow(deprecated)]
fn test_cursor_prepared_statement() -> Result<(), pgrx::spi::Error> {
Spi::connect(|mut client| {
client.update("CREATE TABLE tests.cursor_table (id int)", None, None)?;
Expand Down Expand Up @@ -263,7 +261,6 @@ mod tests {
test_cursor_prepared_statement_panics_impl(Some([None, None].to_vec()))
}

#[allow(deprecated)]
fn test_cursor_prepared_statement_panics_impl(
args: Option<Vec<Option<pg_sys::Datum>>>,
) -> Result<(), pgrx::spi::Error> {
Expand All @@ -285,7 +282,6 @@ mod tests {
}

#[pg_test]
#[allow(deprecated)]
fn test_cursor_by_name() -> Result<(), pgrx::spi::Error> {
let cursor_name = Spi::connect(|mut client| {
client.update("CREATE TABLE tests.cursor_table (id int)", None, None)?;
Expand Down Expand Up @@ -317,15 +313,13 @@ mod tests {
}

#[pg_test(error = "syntax error at or near \"THIS\"")]
#[allow(deprecated)]
fn test_cursor_failure() {
Spi::connect(|client| {
client.open_cursor("THIS IS NOT SQL", None);
})
}

#[pg_test(error = "cursor: CursorNotFound(\"NOT A CURSOR\")")]
#[allow(deprecated)]
fn test_cursor_not_found() {
Spi::connect(|client| client.find_cursor("NOT A CURSOR").map(|_| ())).expect("cursor");
}
Expand Down Expand Up @@ -358,7 +352,6 @@ mod tests {
}

#[pg_test]
#[allow(deprecated)]
fn test_spi_non_mut() -> Result<(), pgrx::spi::Error> {
// Ensures update and cursor APIs do not need mutable reference to SpiClient
Spi::connect(|mut client| {
Expand Down
2 changes: 0 additions & 2 deletions pgrx/src/spi/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ impl<'conn> SpiClient<'conn> {
/// # Panics
///
/// Panics if a cursor wasn't opened.
#[deprecated(since = "0.12.2", note = "undefined behavior")]
pub fn open_cursor<Q: Query<'conn>>(&self, query: Q, args: Q::Arguments) -> SpiCursor<'conn> {
self.try_open_cursor(query, args).unwrap()
}
Expand Down Expand Up @@ -152,7 +151,6 @@ impl<'conn> SpiClient<'conn> {
/// # Panics
///
/// Panics if a cursor wasn't opened.
#[deprecated(since = "0.12.2", note = "undefined behavior")]
pub fn open_cursor_mut<Q: Query<'conn>>(
&mut self,
query: Q,
Expand Down
1 change: 0 additions & 1 deletion pgrx/src/spi/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ pub trait Query<'conn>: Sized {
/// # Panics
///
/// Panics if a cursor wasn't opened.
#[deprecated(since = "0.12.2", note = "undefined behavior")]
fn open_cursor(self, client: &SpiClient<'conn>, args: Self::Arguments) -> SpiCursor<'conn> {
self.try_open_cursor(client, args).unwrap()
}
Expand Down

0 comments on commit bc10a92

Please sign in to comment.