rbatis_codegen/codegen/syntax_tree_pysql/trim_node.rs
1use crate::codegen::syntax_tree_pysql::{Name, NodeType};
2
3/// Represents a `trim` node in py_sql.
4/// It's used to remove leading and/or trailing characters from a string.
5///
6/// # Examples
7///
8/// PySQL syntax:
9/// ```py
10/// trim ','
11/// trim start=','
12/// trim end=','
13/// ```
14#[derive(Clone, Debug, Eq, PartialEq)]
15pub struct TrimNode {
16 pub childs: Vec<NodeType>,
17 pub start: String,
18 pub end: String,
19}
20
21impl Name for TrimNode {
22 fn name() -> &'static str {
23 "trim"
24 }
25}