Add SQLAssignment struct for use in INSERT

This commit is contained in:
Andy Grove 2018-09-08 08:06:10 -06:00
parent 0d36aa536a
commit e19d559073

View file

@ -93,10 +93,8 @@ pub enum ASTNode {
SQLUpdate { SQLUpdate {
/// TABLE /// TABLE
table_name: String, table_name: String,
/// Columns being assigned /// Column assignments
columns: Vec<String>, assignemnts: Vec<SQLAssigment>,
/// Values being assigned
values: Vec<ASTNode>,
/// WHERE /// WHERE
selection: Option<Box<ASTNode>>, selection: Option<Box<ASTNode>>,
}, },
@ -119,6 +117,13 @@ pub enum ASTNode {
}, },
} }
/// SQL assignment `foo = expr` as used in SQLUpdate
#[derive(Debug, Clone, PartialEq)]
pub struct SQLAssigment {
id: String,
value: Box<ASTNode>
}
/// SQL column definition /// SQL column definition
#[derive(Debug, Clone, PartialEq)] #[derive(Debug, Clone, PartialEq)]
pub struct SQLColumnDef { pub struct SQLColumnDef {