-
-
Notifications
You must be signed in to change notification settings - Fork 255
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement ArgAbi for PgRelation (#1823)
This is missing in 0.12.0. It was originally thought that perhaps extensions didn't need this, as pgrx makes a lot of opinionated choices with PgRelation that aren't always applicable. In actuality there are extensions where this proves to be a significant amount of the 0.12 update friction.
- Loading branch information
Showing
3 changed files
with
33 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
//LICENSE Portions Copyright 2019-2021 ZomboDB, LLC. | ||
//LICENSE | ||
//LICENSE Portions Copyright 2021-2023 Technology Concepts & Design, Inc. | ||
//LICENSE | ||
//LICENSE Portions Copyright 2023-2023 PgCentral Foundation, Inc. <[email protected]> | ||
//LICENSE | ||
//LICENSE All rights reserved. | ||
//LICENSE | ||
//LICENSE Use of this source code is governed by the MIT license that can be found in the LICENSE file. | ||
use pgrx::prelude::*; | ||
use pgrx::rel::PgRelation; | ||
#[pg_extern] | ||
fn accept_relation(rel: PgRelation) { | ||
_ = rel; | ||
} | ||
|
||
#[cfg(any(test, feature = "pg_test"))] | ||
#[pgrx::pg_schema] | ||
mod tests { | ||
#[allow(unused_imports)] | ||
use crate as pgrx_tests; | ||
use pgrx::prelude::*; | ||
|
||
#[pg_test] | ||
fn test_accept_relation() { | ||
Spi::run("CREATE TABLE relation_test(name TEXT);").unwrap(); | ||
Spi::run("CREATE INDEX relation_test_index ON relation_test(name);").unwrap(); | ||
Spi::run("SELECT accept_relation('relation_test_index');").unwrap(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters