pub struct QueryAnalyzer;Expand description
Analyzes compiled GraphQL queries to extract entity constraints.
This analyzer examines the query definition and SQL string to determine:
- Which entity type the query filters on
- How many entities it typically returns
- Whether it has WHERE clause constraints
Implementations§
Source§impl QueryAnalyzer
impl QueryAnalyzer
Sourcepub fn analyze_query(
&self,
query_def: &IRQuery,
query_str: &str,
) -> Result<QueryEntityProfile>
pub fn analyze_query( &self, query_def: &IRQuery, query_str: &str, ) -> Result<QueryEntityProfile>
Analyze a compiled query to extract entity constraints.
§Arguments
query_def- The compiled query definitionquery_str- The query SQL string
§Returns
QueryEntityProfile describing the query’s entity dependencies
§Examples
ⓘ
let profile = analyzer.analyze_query(query_def, "SELECT * FROM users WHERE id = ?")?;
assert_eq!(profile.entity_type, Some("User"));
assert_eq!(profile.cardinality, QueryCardinality::Single);Trait Implementations§
Source§impl Clone for QueryAnalyzer
impl Clone for QueryAnalyzer
Source§fn clone(&self) -> QueryAnalyzer
fn clone(&self) -> QueryAnalyzer
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 QueryAnalyzer
impl Debug for QueryAnalyzer
Auto Trait Implementations§
impl Freeze for QueryAnalyzer
impl RefUnwindSafe for QueryAnalyzer
impl Send for QueryAnalyzer
impl Sync for QueryAnalyzer
impl Unpin for QueryAnalyzer
impl UnsafeUnpin for QueryAnalyzer
impl UnwindSafe for QueryAnalyzer
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