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 {
8181 } ,
8282}
8383
84+ impl Storage {
85+ pub fn is_column ( & self ) -> bool {
86+ match self {
87+ Storage :: Column { .. } => true ,
88+ _ => false ,
89+ }
90+ }
91+ }
8492pub fn read_node_types ( prefix : & str , node_types_path : & Path ) -> std:: io:: Result < NodeTypeMap > {
8593 let file = fs:: File :: open ( node_types_path) ?;
8694 let node_types: Vec < NodeInfo > = serde_json:: from_reader ( file) ?;
@@ -245,10 +253,11 @@ fn add_field(
245253 }
246254 } ;
247255 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) ) )
252261 {
253262 // All possible types for this field are reserved words. The db
254263 // 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 {
8181 } ,
8282}
8383
84+ impl Storage {
85+ pub fn is_column ( & self ) -> bool {
86+ match self {
87+ Storage :: Column { .. } => true ,
88+ _ => false ,
89+ }
90+ }
91+ }
8492pub fn read_node_types ( prefix : & str , node_types_path : & Path ) -> std:: io:: Result < NodeTypeMap > {
8593 let file = fs:: File :: open ( node_types_path) ?;
8694 let node_types: Vec < NodeInfo > = serde_json:: from_reader ( file) ?;
@@ -245,10 +253,11 @@ fn add_field(
245253 }
246254 } ;
247255 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) ) )
252261 {
253262 // All possible types for this field are reserved words. The db
254263 // representation will be an `int` with a `case @foo.field = ...` to
You can’t perform that action at this time.
0 commit comments