@@ -157,7 +157,7 @@ def database_table_schema(self, colsep='|') -> None:
157157 if skip_operation (sql_x ):
158158 if sql_x == mq .not_implemented :
159159 z = mq .not_implemented
160- print (z .format ("TABLES" , self .db_type .upper ()))
160+ print (' \n ' + z .format ("TABLES" , self .db_type .upper ()))
161161 elif sql_x == mq .not_possible_sql :
162162 z = mq .not_possible_sql
163163 print (z .format (self .db_type .upper (), self .db_lib_name .upper ()))
@@ -209,12 +209,13 @@ def database_table_schema(self, colsep='|') -> None:
209209 if skip_operation (sql_x ):
210210 if sql_x == mq .not_implemented :
211211 z = mq .not_implemented
212- print (z .format ("TABLE'S COLUMNS" , self .db_type .upper ()))
212+ print (' \n ' + z .format ("TABLE'S COLUMNS" , self .db_type .upper ()))
213213 elif sql_x == mq .not_possible_sql :
214214 z = mq .not_possible_sql
215215 print (z .format (self .db_type .upper (), self .db_lib_name .upper ()))
216216 else :
217217 columns_col_names , columns_rows = self ._find_table_columns (my_table )
218+ print ('\n Here are the columns for table {}:' .format (my_table ))
218219 writer1 .write_rows (columns_rows , columns_col_names )
219220 print ()
220221
@@ -223,7 +224,7 @@ def database_table_schema(self, colsep='|') -> None:
223224 if skip_operation (sql_x ):
224225 if sql_x == mq .not_implemented :
225226 z = mq .not_implemented
226- print (z .format ("INDEXES" , self .db_type .upper ()))
227+ print (' \n ' + z .format ("INDEXES" , self .db_type .upper ()))
227228 elif sql_x == mq .not_possible_sql :
228229 z = mq .not_possible_sql
229230 print (z .format (self .db_type .upper (), self .db_lib_name .upper ()))
@@ -238,7 +239,7 @@ def database_table_schema(self, colsep='|') -> None:
238239 if skip_operation (sql_x ):
239240 if sql_x == mq .not_implemented :
240241 z = mq .not_implemented
241- print (z .format ("INDEX'S COLUMNS" , self .db_type .upper ()))
242+ print (' \n ' + z .format ("INDEX'S COLUMNS" , self .db_type .upper ()))
242243 elif sql_x == mq .not_possible_sql :
243244 z = mq .not_possible_sql
244245 print (z .format (self .db_type .upper (), self .db_lib_name .upper ()))
@@ -249,20 +250,18 @@ def database_table_schema(self, colsep='|') -> None:
249250 # Concatenate names of columns in index. In function-based indexes,
250251 # use user_ind_expressions.column_expression instead of
251252 # user_ind_columns.column_name.
252- index_columns = ''
253+ index_columns = list ()
253254 for column_pos , column_name , descend , column_expr in ind_col_rows :
254- if index_columns != '' :
255- index_columns += ', '
256255 if column_expr is None or column_expr == '' :
257- index_columns += column_name + ' ' + descend
256+ index_columns . append ( column_name + ' ' + descend )
258257 else :
259- index_columns += column_expr + ' ' + descend
260- index_columns = '(' + index_columns + ')'
258+ index_columns . append ( column_expr + ' ' + descend )
259+ index_columns = '(' + ', ' . join ( index_columns ) + ')'
261260 # Add index_columns to end of each index/row (index is a tuple!).
262261 indexes_rows [count ] = index_row + (index_columns ,)
263262
264263 # Print output.
265- print ()
264+ print (' \n Here are the indexes on table {}:' . format ( my_table ) )
266265 writer1 .write_rows (indexes_rows , indexes_col_names )
267266 writer1 .close_output_file ()
268267 return
@@ -281,7 +280,7 @@ def database_view_schema(self, colsep='|') -> None:
281280 if skip_operation (sql_x ):
282281 if sql_x == mq .not_implemented :
283282 z = mq .not_implemented
284- print (z .format ("VIEWS" , self .db_type .upper ()))
283+ print (' \n ' + z .format ("VIEWS" , self .db_type .upper ()))
285284 elif sql_x == mq .not_possible_sql :
286285 z = mq .not_possible_sql
287286 print (z .format (self .db_type .upper (), self .db_lib_name .upper ()))
@@ -334,7 +333,8 @@ def database_view_schema(self, colsep='|') -> None:
334333 my_view_sql = my_view [columns ['view_sql' ]]
335334
336335 # Print the sql for this view.
337- print ('\n Here is the SQL for this view:\n "{}"' .format (my_view_sql ))
336+ z = '\n Here is the SQL for view {}:\n "{}"'
337+ print (z .format (my_view_name , my_view_sql ))
338338
339339 # Set up to write output.
340340 writer1 = OutputWriter (out_file_name = '' , align_col = True , col_sep = colsep )
@@ -349,6 +349,7 @@ def database_view_schema(self, colsep='|') -> None:
349349 z = mq .not_possible_sql
350350 print (z .format (self .db_type .upper (), self .db_lib_name .upper ()))
351351 return
352+ print ('\n Here are the columns for view {}:' .format (my_view_name ))
352353 columns_col_names , columns_rows = self ._find_view_columns (my_view_name )
353354
354355 writer1 .write_rows (columns_rows , columns_col_names )
0 commit comments