Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update with pgrx upstream and remove compilation warning #207

Merged
merged 1 commit into from
Dec 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions supabase-wrappers/src/interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use pgrx::pg_sys::panic::ErrorReport;
use pgrx::prelude::{Date, Timestamp};
use pgrx::{
fcinfo,
pg_sys::{self, Datum, Oid},
pg_sys::{self, BuiltinOid, Datum, Oid},
AllocatedByRust, AnyNumeric, FromDatum, IntoDatum, JsonB, PgBuiltInOids, PgOid,
};
use std::collections::HashMap;
Expand All @@ -22,13 +22,16 @@ use std::slice::Iter;
// https://doxygen.postgresql.org/pg__foreign__table_8h.html

/// Constant can be used in [validator](ForeignDataWrapper::validator)
// Note: temporarily disable warning here, can be removed after this upstream PR
// is merged. https://github.com/pgcentralfoundation/pgrx/pull/1432.
#[allow(deprecated)]
pub const FOREIGN_DATA_WRAPPER_RELATION_ID: Oid = unsafe { Oid::from_u32_unchecked(2328) };

/// Constant can be used in [validator](ForeignDataWrapper::validator)
pub const FOREIGN_SERVER_RELATION_ID: Oid = unsafe { Oid::from_u32_unchecked(1417) };
pub const FOREIGN_SERVER_RELATION_ID: Oid = BuiltinOid::ForeignServerRelationId.value();

/// Constant can be used in [validator](ForeignDataWrapper::validator)
pub const FOREIGN_TABLE_RELATION_ID: Oid = unsafe { Oid::from_u32_unchecked(3118) };
pub const FOREIGN_TABLE_RELATION_ID: Oid = BuiltinOid::ForeignTableRelationId.value();

/// A data cell in a data row
#[derive(Debug)]
Expand Down
3 changes: 2 additions & 1 deletion supabase-wrappers/src/limit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ pub(crate) unsafe fn extract_limit(

// only consider OFFSETS that are non-NULL constants
let limit_offset = (*parse).limitOffset as *mut pg_sys::Const;
if !limit_offset.is_null() && is_a(limit_offset as *mut pg_sys::Node, pg_sys::NodeTag::T_Const) {
if !limit_offset.is_null() && is_a(limit_offset as *mut pg_sys::Node, pg_sys::NodeTag::T_Const)
{
if let Some(offset) = i64::from_polymorphic_datum(
(*limit_offset).constvalue,
(*limit_offset).constisnull,
Expand Down
Loading