pub trait UserDefinedLogicalNodeUnparser {
// Provided methods
fn unparse(
&self,
_node: &dyn UserDefinedLogicalNode,
_unparser: &Unparser<'_>,
_query: &mut Option<&mut QueryBuilder>,
_select: &mut Option<&mut SelectBuilder>,
_relation: &mut Option<&mut RelationBuilder>,
) -> Result<UnparseWithinStatementResult> { ... }
fn unparse_to_statement(
&self,
_node: &dyn UserDefinedLogicalNode,
_unparser: &Unparser<'_>,
) -> Result<UnparseToStatementResult> { ... }
}
Expand description
This trait allows users to define custom unparser logic for their custom logical nodes.
Provided Methods§
Sourcefn unparse(
&self,
_node: &dyn UserDefinedLogicalNode,
_unparser: &Unparser<'_>,
_query: &mut Option<&mut QueryBuilder>,
_select: &mut Option<&mut SelectBuilder>,
_relation: &mut Option<&mut RelationBuilder>,
) -> Result<UnparseWithinStatementResult>
fn unparse( &self, _node: &dyn UserDefinedLogicalNode, _unparser: &Unparser<'_>, _query: &mut Option<&mut QueryBuilder>, _select: &mut Option<&mut SelectBuilder>, _relation: &mut Option<&mut RelationBuilder>, ) -> Result<UnparseWithinStatementResult>
Unparse the custom logical node to SQL within a statement.
This method is called when the custom logical node is part of a statement.
e.g. SELECT * FROM custom_logical_node
The return value should be UnparseWithinStatementResult::Modified if the custom logical node was successfully unparsed. Otherwise, return UnparseWithinStatementResult::Unmodified.
Sourcefn unparse_to_statement(
&self,
_node: &dyn UserDefinedLogicalNode,
_unparser: &Unparser<'_>,
) -> Result<UnparseToStatementResult>
fn unparse_to_statement( &self, _node: &dyn UserDefinedLogicalNode, _unparser: &Unparser<'_>, ) -> Result<UnparseToStatementResult>
Unparse the custom logical node to a statement.
This method is called when the custom logical node is a custom statement.
The return value should be UnparseToStatementResult::Modified if the custom logical node was successfully unparsed. Otherwise, return UnparseToStatementResult::Unmodified.