File tree Expand file tree Collapse file tree 6 files changed +392
-81
lines changed Expand file tree Collapse file tree 6 files changed +392
-81
lines changed Original file line number Diff line number Diff line change @@ -18,3 +18,4 @@ name = "sqlparser"
1818path = " src/lib.rs"
1919
2020[dependencies ]
21+ log = " 0.4.5"
Original file line number Diff line number Diff line change @@ -432,6 +432,12 @@ impl Dialect for GenericSqlDialect {
432432 "DATE" ,
433433 "TIME" ,
434434 "TIMESTAMP" ,
435+ "VALUES" ,
436+ "DEFAULT" ,
437+ "ZONE" ,
438+ "REGCLASS" ,
439+ "TEXT" ,
440+ "BYTEA" ,
435441 ] ;
436442 }
437443
Original file line number Diff line number Diff line change 3535//! println!("AST: {:?}", ast);
3636//! ```
3737
38+ #[ macro_use]
39+ extern crate log;
40+
3841pub mod dialect;
3942pub mod sqlast;
4043pub mod sqlparser;
Original file line number Diff line number Diff line change @@ -135,15 +135,16 @@ pub struct SQLColumnDef {
135135 pub name : String ,
136136 pub data_type : SQLType ,
137137 pub allow_null : bool ,
138+ pub default : Option < Box < ASTNode > > ,
138139}
139140
140141/// SQL datatypes for literals in SQL statements
141142#[ derive( Debug , Clone , PartialEq ) ]
142143pub enum SQLType {
143144 /// Fixed-length character type e.g. CHAR(10)
144- Char ( usize ) ,
145+ Char ( Option < usize > ) ,
145146 /// Variable-length character type e.g. VARCHAR(10)
146- Varchar ( usize ) ,
147+ Varchar ( Option < usize > ) ,
147148 /// Large character object e.g. CLOB(1000)
148149 Clob ( usize ) ,
149150 /// Fixed-length binary type e.g. BINARY(10)
@@ -174,6 +175,16 @@ pub enum SQLType {
174175 Time ,
175176 /// Timestamp
176177 Timestamp ,
178+ /// Regclass used in postgresql serial
179+ Regclass ,
180+ /// Text
181+ Text ,
182+ /// Bytea
183+ Bytea ,
184+ /// Custom type such as enums
185+ Custom ( String ) ,
186+ /// Arrays
187+ Array ( Box < SQLType > ) ,
177188}
178189
179190/// SQL Operator
You can’t perform that action at this time.
0 commit comments