-
-
Notifications
You must be signed in to change notification settings - Fork 254
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pg_cast
validate attributes at macro expansion time.
- Validate attributes at compile time before delegating to `PgExtern` - Using `pg_cast` and `pg_extern` on the same item will result in duplicate definitions - Added a `as_cast(PgCast)` option to `PgExtern` to augment `PgExtern`. Did not implement this as `PgExtern` attribute to avoid poluting `PgExtern` options
- Loading branch information
Louis Kuang
committed
Jan 24, 2024
1 parent
99643d0
commit 752f3af
Showing
6 changed files
with
83 additions
and
43 deletions.
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
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
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,8 @@ | ||
use pgrx::prelude::*; | ||
|
||
#[pg_cast] | ||
pub fn cast_function() -> i32 { | ||
0 | ||
} | ||
|
||
fn main() {} |
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,8 @@ | ||
use pgrx::prelude::*; | ||
|
||
#[pg_cast(invalid_opt)] | ||
pub fn cast_function(foo: i32) -> i32 { | ||
foo | ||
} | ||
|
||
fn main() {} |