File tree Expand file tree Collapse file tree 2 files changed +26
-8
lines changed Expand file tree Collapse file tree 2 files changed +26
-8
lines changed Original file line number Diff line number Diff line change @@ -81,6 +81,14 @@ pub enum Storage {
81
81
} ,
82
82
}
83
83
84
+ impl Storage {
85
+ pub fn is_column ( & self ) -> bool {
86
+ match self {
87
+ Storage :: Column { .. } => true ,
88
+ _ => false ,
89
+ }
90
+ }
91
+ }
84
92
pub fn read_node_types ( prefix : & str , node_types_path : & Path ) -> std:: io:: Result < NodeTypeMap > {
85
93
let file = fs:: File :: open ( node_types_path) ?;
86
94
let node_types: Vec < NodeInfo > = serde_json:: from_reader ( file) ?;
@@ -245,10 +253,11 @@ fn add_field(
245
253
}
246
254
} ;
247
255
let converted_types = convert_types ( & field_info. types ) ;
248
- let type_info = if field_info
249
- . types
250
- . iter ( )
251
- . all ( |t| !t. named && token_kinds. contains ( & convert_type ( t) ) )
256
+ let type_info = if storage. is_column ( )
257
+ && field_info
258
+ . types
259
+ . iter ( )
260
+ . all ( |t| !t. named && token_kinds. contains ( & convert_type ( t) ) )
252
261
{
253
262
// All possible types for this field are reserved words. The db
254
263
// representation will be an `int` with a `case @foo.field = ...` to
Original file line number Diff line number Diff line change @@ -81,6 +81,14 @@ pub enum Storage {
81
81
} ,
82
82
}
83
83
84
+ impl Storage {
85
+ pub fn is_column ( & self ) -> bool {
86
+ match self {
87
+ Storage :: Column { .. } => true ,
88
+ _ => false ,
89
+ }
90
+ }
91
+ }
84
92
pub fn read_node_types ( prefix : & str , node_types_path : & Path ) -> std:: io:: Result < NodeTypeMap > {
85
93
let file = fs:: File :: open ( node_types_path) ?;
86
94
let node_types: Vec < NodeInfo > = serde_json:: from_reader ( file) ?;
@@ -245,10 +253,11 @@ fn add_field(
245
253
}
246
254
} ;
247
255
let converted_types = convert_types ( & field_info. types ) ;
248
- let type_info = if field_info
249
- . types
250
- . iter ( )
251
- . all ( |t| !t. named && token_kinds. contains ( & convert_type ( t) ) )
256
+ let type_info = if storage. is_column ( )
257
+ && field_info
258
+ . types
259
+ . iter ( )
260
+ . all ( |t| !t. named && token_kinds. contains ( & convert_type ( t) ) )
252
261
{
253
262
// All possible types for this field are reserved words. The db
254
263
// representation will be an `int` with a `case @foo.field = ...` to
You can’t perform that action at this time.
0 commit comments