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 {
/// TABLE
table_name: String,
/// Columns being assigned
columns: Vec<String>,
/// Values being assigned
values: Vec<ASTNode>,
/// Column assignments
assignemnts: Vec<SQLAssigment>,
/// WHERE
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
#[derive(Debug, Clone, PartialEq)]
pub struct SQLColumnDef {