pub struct PostgresIntrospector { /* private fields */ }Expand description
PostgreSQL introspector for fact table metadata.
Implementations§
Source§impl PostgresIntrospector
impl PostgresIntrospector
Sourcepub async fn get_indexed_nested_columns(
&self,
view_name: &str,
) -> Result<HashSet<String>>
pub async fn get_indexed_nested_columns( &self, view_name: &str, ) -> Result<HashSet<String>>
Get indexed columns for a view/table that match the nested path naming convention.
This method introspects the database to find columns that follow the FraiseQL indexed column naming conventions:
- Human-readable:
items__product__category__code(double underscore separated) - Entity ID format:
f{entity_id}__{field_name}(e.g.,f200100__code)
These columns are created by DBAs to optimize filtering on nested GraphQL paths by avoiding JSONB extraction at runtime.
§Arguments
view_name- Name of the view or table to introspect
§Returns
Set of column names that match the indexed column naming conventions.
§Example
ⓘ
let introspector = PostgresIntrospector::new(pool);
let indexed_cols = introspector.get_indexed_nested_columns("v_order_items").await?;
// Returns: {"items__product__category__code", "f200100__code", ...}Trait Implementations§
Source§impl DatabaseIntrospector for PostgresIntrospector
impl DatabaseIntrospector for PostgresIntrospector
Source§fn list_fact_tables<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_fact_tables<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
List all fact tables in the database (tables starting with “tf_”) Read more
Source§fn get_columns<'life0, 'life1, 'async_trait>(
&'life0 self,
table_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<(String, String, bool)>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_columns<'life0, 'life1, 'async_trait>(
&'life0 self,
table_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<(String, String, bool)>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Query column information for a table Read more
Source§fn get_indexed_columns<'life0, 'life1, 'async_trait>(
&'life0 self,
table_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_indexed_columns<'life0, 'life1, 'async_trait>(
&'life0 self,
table_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Query indexes for a table Read more
Source§fn database_type(&self) -> DatabaseType
fn database_type(&self) -> DatabaseType
Get database type (for SQL type parsing)
Source§fn get_sample_jsonb<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
table_name: &'life1 str,
column_name: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Value>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_sample_jsonb<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
table_name: &'life1 str,
column_name: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Value>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Get sample JSONB data from a column to extract dimension paths Read more
Auto Trait Implementations§
impl Freeze for PostgresIntrospector
impl !RefUnwindSafe for PostgresIntrospector
impl Send for PostgresIntrospector
impl Sync for PostgresIntrospector
impl Unpin for PostgresIntrospector
impl UnsafeUnpin for PostgresIntrospector
impl !UnwindSafe for PostgresIntrospector
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