File tree Expand file tree Collapse file tree
diesel_cli/src/infer_schema_internals Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -176,14 +176,15 @@ where
176176{
177177 use self :: information_schema:: tables:: dsl:: * ;
178178
179+ let default_schema = Conn :: Backend :: default_schema ( connection) ?;
179180 let db_schema_name = match schema_name {
180- Some ( name) => Cow :: Borrowed ( name) ,
181- None => Cow :: Owned ( Conn :: Backend :: default_schema ( connection ) ? ) ,
181+ Some ( name) => name,
182+ None => & default_schema,
182183 } ;
183184
184185 let mut table_names = tables
185186 . select ( table_name)
186- . filter ( table_schema. eq ( db_schema_name. as_ref ( ) ) )
187+ . filter ( table_schema. eq ( db_schema_name) )
187188 . filter ( table_name. not_like ( "\\ _\\ _%" ) )
188189 . filter ( table_type. like ( "BASE TABLE" ) )
189190 . load :: < String > ( connection) ?;
@@ -192,7 +193,9 @@ where
192193 . into_iter ( )
193194 . map ( |name| TableName {
194195 name,
195- schema : schema_name. map ( |schema| schema. to_owned ( ) ) ,
196+ schema : schema_name
197+ . filter ( |& schema| schema != default_schema)
198+ . map ( |schema| schema. to_owned ( ) ) ,
196199 } )
197200 . collect ( ) )
198201}
You can’t perform that action at this time.
0 commit comments