pub struct SqlContext {
pub pg_major_version: i32,
pub relation_inventory: BTreeMap<(ObjectType, String), Vec<String>>,
}Expand description
Context controlling version-dependent SQL generation.
Fields§
§pg_major_version: i32PostgreSQL major version (e.g., 14, 15, 16, 17).
Controls syntax differences like WITH INHERIT in membership grants.
relation_inventory: BTreeMap<(ObjectType, String), Vec<String>>Optional schema-scoped catalog inventory used to safely expand wildcard relation statements without leaking across relation subtypes.
Implementations§
Source§impl SqlContext
impl SqlContext
Sourcepub fn from_version_num(version_num: i32) -> Self
pub fn from_version_num(version_num: i32) -> Self
Create a context for a specific PG version number (from server_version_num).
Sourcepub fn with_relation_inventory(
self,
relation_inventory: BTreeMap<(ObjectType, String), Vec<String>>,
) -> Self
pub fn with_relation_inventory( self, relation_inventory: BTreeMap<(ObjectType, String), Vec<String>>, ) -> Self
Attach live relation inventory for safer wildcard rendering.
Sourcepub fn supports_grant_with_options(&self) -> bool
pub fn supports_grant_with_options(&self) -> bool
Whether PG supports GRANT ... WITH INHERIT TRUE/FALSE (PG 16+).
Trait Implementations§
Source§impl Clone for SqlContext
impl Clone for SqlContext
Source§fn clone(&self) -> SqlContext
fn clone(&self) -> SqlContext
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SqlContext
impl Debug for SqlContext
Auto Trait Implementations§
impl Freeze for SqlContext
impl RefUnwindSafe for SqlContext
impl Send for SqlContext
impl Sync for SqlContext
impl Unpin for SqlContext
impl UnsafeUnpin for SqlContext
impl UnwindSafe for SqlContext
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more