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"
18
18
path = " src/lib.rs"
19
19
20
20
[dependencies ]
21
+ log = " 0.4.5"
Original file line number Diff line number Diff line change @@ -432,6 +432,12 @@ impl Dialect for GenericSqlDialect {
432
432
"DATE" ,
433
433
"TIME" ,
434
434
"TIMESTAMP" ,
435
+ "VALUES" ,
436
+ "DEFAULT" ,
437
+ "ZONE" ,
438
+ "REGCLASS" ,
439
+ "TEXT" ,
440
+ "BYTEA" ,
435
441
] ;
436
442
}
437
443
Original file line number Diff line number Diff line change 35
35
//! println!("AST: {:?}", ast);
36
36
//! ```
37
37
38
+ #[ macro_use]
39
+ extern crate log;
40
+
38
41
pub mod dialect;
39
42
pub mod sqlast;
40
43
pub mod sqlparser;
Original file line number Diff line number Diff line change @@ -135,15 +135,16 @@ pub struct SQLColumnDef {
135
135
pub name : String ,
136
136
pub data_type : SQLType ,
137
137
pub allow_null : bool ,
138
+ pub default : Option < Box < ASTNode > > ,
138
139
}
139
140
140
141
/// SQL datatypes for literals in SQL statements
141
142
#[ derive( Debug , Clone , PartialEq ) ]
142
143
pub enum SQLType {
143
144
/// Fixed-length character type e.g. CHAR(10)
144
- Char ( usize ) ,
145
+ Char ( Option < usize > ) ,
145
146
/// Variable-length character type e.g. VARCHAR(10)
146
- Varchar ( usize ) ,
147
+ Varchar ( Option < usize > ) ,
147
148
/// Large character object e.g. CLOB(1000)
148
149
Clob ( usize ) ,
149
150
/// Fixed-length binary type e.g. BINARY(10)
@@ -174,6 +175,16 @@ pub enum SQLType {
174
175
Time ,
175
176
/// Timestamp
176
177
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 > ) ,
177
188
}
178
189
179
190
/// SQL Operator
You can’t perform that action at this time.
0 commit comments