@@ -148,41 +148,37 @@ pub fn get_primary_keys(conn: &SqliteConnection, table: &TableData) -> QueryResu
148148 . collect ( ) )
149149}
150150
151- fn diesel_type ( t : & str ) -> Vec < String > {
152- vec ! [ "diesel" . into( ) , "types" . into( ) , t. into( ) ]
153- }
154-
155151pub fn determine_column_type ( attr : & ColumnInformation ) -> Result < ColumnType , Box < Error > > {
156152 let type_name = attr. type_name . to_lowercase ( ) ;
157153 let path = if is_bool ( & type_name) {
158- diesel_type ( "Bool" )
154+ String :: from ( "Bool" )
159155 } else if is_smallint ( & type_name) {
160- diesel_type ( "SmallInt" )
156+ String :: from ( "SmallInt" )
161157 } else if is_bigint ( & type_name) {
162- diesel_type ( "BigInt" )
158+ String :: from ( "BigInt" )
163159 } else if type_name. contains ( "int" ) {
164- diesel_type ( "Integer" )
160+ String :: from ( "Integer" )
165161 } else if is_text ( & type_name) {
166- diesel_type ( "Text" )
162+ String :: from ( "Text" )
167163 } else if type_name. contains ( "blob" ) || type_name. is_empty ( ) {
168- diesel_type ( "Binary" )
164+ String :: from ( "Binary" )
169165 } else if is_float ( & type_name) {
170- diesel_type ( "Float" )
166+ String :: from ( "Float" )
171167 } else if is_double ( & type_name) {
172- diesel_type ( "Double" )
168+ String :: from ( "Double" )
173169 } else if type_name == "datetime" || type_name == "timestamp" {
174- diesel_type ( "Timestamp" )
170+ String :: from ( "Timestamp" )
175171 } else if type_name == "date" {
176- diesel_type ( "Date" )
172+ String :: from ( "Date" )
177173 } else if type_name == "time" {
178- diesel_type ( "Time" )
174+ String :: from ( "Time" )
179175 }
180176 else {
181177 return Err ( format ! ( "Unsupported type: {}" , type_name) . into ( ) )
182178 } ;
183179
184180 Ok ( ColumnType {
185- path : path,
181+ rust_name : path,
186182 is_array : false ,
187183 is_nullable : attr. nullable ,
188184 } )
0 commit comments