pub struct QueryNode {Show 13 fields
pub id: String,
pub table: String,
pub relationship_type: Option<RelationshipType>,
pub relationship_metadata: Option<RelationshipMetadata>,
pub parent_id: Option<String>,
pub children: Vec<String>,
pub depth: usize,
pub estimated_rows: usize,
pub parallel_safe: bool,
pub foreign_key: Option<String>,
pub constraints: Vec<String>,
pub available_columns: Vec<String>,
pub index_hints: Vec<String>,
}Expand description
Represents a node in the query execution plan
Fields§
§id: StringUnique identifier for this node
table: StringTable to query
relationship_type: Option<RelationshipType>Type of relationship from parent
relationship_metadata: Option<RelationshipMetadata>Full relationship metadata if available
parent_id: Option<String>Parent node ID (None for root)
children: Vec<String>Child node IDs
depth: usizeDepth in the relationship tree
estimated_rows: usizeEstimated row count (can be updated from metadata)
parallel_safe: boolWhether this node can be executed in parallel with siblings
foreign_key: Option<String>Foreign key used to join with parent
constraints: Vec<String>Additional constraints for optimization
available_columns: Vec<String>Column names available in this table (for better query construction)
index_hints: Vec<String>Index hints for the optimizer
Implementations§
Source§impl QueryNode
impl QueryNode
Sourcepub fn child(
id: String,
table: String,
parent_id: String,
relationship_type: RelationshipType,
foreign_key: String,
) -> Self
pub fn child( id: String, table: String, parent_id: String, relationship_type: RelationshipType, foreign_key: String, ) -> Self
Create a child node with parent relationship
Sourcepub fn child_with_metadata(
id: String,
table: String,
parent_id: String,
metadata: RelationshipMetadata,
) -> Self
pub fn child_with_metadata( id: String, table: String, parent_id: String, metadata: RelationshipMetadata, ) -> Self
Create a child node with full relationship metadata
Sourcepub fn set_estimated_rows(&mut self, rows: usize)
pub fn set_estimated_rows(&mut self, rows: usize)
Set row count estimate
Sourcepub fn set_parallel_safe(&mut self, safe: bool)
pub fn set_parallel_safe(&mut self, safe: bool)
Set parallel safety
Sourcepub fn add_constraint(&mut self, constraint: String)
pub fn add_constraint(&mut self, constraint: String)
Add a constraint
Sourcepub fn set_metadata(&mut self, metadata: RelationshipMetadata)
pub fn set_metadata(&mut self, metadata: RelationshipMetadata)
Update metadata for this node
Sourcepub fn set_columns(&mut self, columns: Vec<String>)
pub fn set_columns(&mut self, columns: Vec<String>)
Set column information for better query construction
Sourcepub fn add_index_hint(&mut self, index: String)
pub fn add_index_hint(&mut self, index: String)
Add index hints for optimization
Sourcepub fn primary_key(&self) -> &str
pub fn primary_key(&self) -> &str
Get the primary key column name (defaults to “id”)
Sourcepub fn get_foreign_key(&self) -> Option<&str>
pub fn get_foreign_key(&self) -> Option<&str>
Get the foreign key column name for relationships
Sourcepub fn is_collection(&self) -> bool
pub fn is_collection(&self) -> bool
Check if this node represents a collection relationship
Sourcepub fn requires_pivot(&self) -> bool
pub fn requires_pivot(&self) -> bool
Check if this node requires a pivot table
Trait Implementations§
Auto Trait Implementations§
impl Freeze for QueryNode
impl RefUnwindSafe for QueryNode
impl Send for QueryNode
impl Sync for QueryNode
impl Unpin for QueryNode
impl UnwindSafe for QueryNode
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more