pub struct ScriptDependencyGraph {
pub statements: Vec<StatementNode>,
pub table_creators: HashMap<String, usize>,
}
Expand description
Dependency graph for a SQL script (temp table dependencies between statements)
Fields§
§statements: Vec<StatementNode>
All statements in the script
table_creators: HashMap<String, usize>
Map of table name -> statement index that creates it
Implementations§
Source§impl ScriptDependencyGraph
impl ScriptDependencyGraph
Sourcepub fn analyze(script_content: &str) -> Result<Self>
pub fn analyze(script_content: &str) -> Result<Self>
Analyze a SQL script and build the dependency graph
This parses the entire script, identifies what tables each statement creates and depends on, and builds a graph of dependencies.
Sourcepub fn get_dependencies(&self, target_index: usize) -> Result<Vec<usize>>
pub fn get_dependencies(&self, target_index: usize) -> Result<Vec<usize>>
Get the minimal set of statement indices needed to execute a target statement
Returns statements in execution order (dependencies first, target last)
Sourcepub fn explain_dependencies(&self, target_index: usize) -> Result<String>
pub fn explain_dependencies(&self, target_index: usize) -> Result<String>
Generate a debug report showing the dependency analysis
Sourcepub fn get_statement(&self, index: usize) -> Option<&StatementNode>
pub fn get_statement(&self, index: usize) -> Option<&StatementNode>
Get a statement by its index
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ScriptDependencyGraph
impl RefUnwindSafe for ScriptDependencyGraph
impl Send for ScriptDependencyGraph
impl Sync for ScriptDependencyGraph
impl Unpin for ScriptDependencyGraph
impl UnwindSafe for ScriptDependencyGraph
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
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>
Converts
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>
Converts
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