pub fn parse_pg_cast(&mut self, expr: ASTNode) -> Result<ASTNode, ParserError> {
        let _ = self.consume_token(&Token::DoubleColon)?;
        let datatype = if let Ok(data_type) = self.parse_data_type() {
            Ok(data_type)
        } else if let Ok(table_name) = self.parse_tablename() {
            Ok(SQLType::Custom(table_name))
        } else {
            parser_err!("Expecting datatype or identifier")
        };
        let pg_cast = ASTNode::SQLCast {
            expr: Box::new(expr),
            data_type: datatype?,
        };
        if let Some(Token::DoubleColon) = self.peek_token() {
            self.parse_pg_cast(pg_cast)
        } else {
            Ok(pg_cast)
        }
    }
/// Parse a postgresql casting style which is in the form or expr::datatype
Parse a postgresql casting style which is in the form or expr::datatype
Parse a postgresql casting style which is in the form or expr :: datatype
pub fn parse_pg_cast(&mut self, expr: ASTNode) -> Result<ASTNode, ParserError> {
        let _ = self.consume_token(&Token::DoubleColon)?;
        let datatype = if let Ok(data_type) = self.parse_data_type() {
            Ok(data_type)
        } else if let Ok(table_name) = self.parse_tablename() {
            Ok(SQLType::Custom(table_name))
        } else {
            parser_err!("Expecting datatype or identifier")
        };
        let pg_cast = ASTNode::SQLCast {
            expr: Box::new(expr),
            data_type: datatype?,
        };
        if let Some(Token::DoubleColon) = self.peek_token() {
            self.parse_pg_cast(pg_cast)
        } else {
            Ok(pg_cast)
        }
    }
pub fn parse_pg_cast ( & mut self , expr : ASTNode ) -> Result < ASTNode , ParserError > { let _ = self . consume_token ( & Token :: DoubleColon ) ? ; let datatype = if let Ok ( data_type ) = self . parse_data_type ( ) { Ok ( data_type ) } else if let Ok ( table_name ) = self . parse_tablename ( ) { Ok ( SQLType :: Custom ( table_name ) ) } else { parser_err ! ( " " ) } ; let pg_cast = ASTNode :: SQLCast { expr : Box :: new ( expr ) , data_type : datatype ? , } ; if let Some ( Token :: DoubleColon ) = self . peek_token ( ) { self . parse_pg_cast ( pg_cast ) } else { Ok ( pg_cast ) } }
Parse a postgresql casting style which is in the form or expr::datatype
Parse a postgresql casting style which is in the form or expr :: datatype
&mut self
expr
ASTNode
&mut self
expr
ASTNode