[ 
http://issues.apache.org/jira/browse/DERBY-1164?page=comments#action_12375258 ] 

Andrew McIntyre commented on DERBY-1164:
----------------------------------------

Hi Håvard,

This patch is looking pretty good. A few comments:

- the ij help command should be updated to include a description of the 
DESCRIBE command.

- better error handling for bad syntax and validating proper input of table 
names would be nice, but not a necessity. For example, try entering in bad 
schema or table names: 'show tables in blah;' or 'describe blah;' where blah 
doesn't exist. Again, not a necessity. It might be more trouble than it is 
worth.

- a 'show indexes' command (corresponding to DatabaseMetadata.getIndexInfo) for 
a table would be nice, but not a necessity for the patch to be committed. That 
could be added later, same for showing primary/foreign keys on a table.

- as for displaying the results nicely, perhaps you could alter 
ijResultSetResult so that it takes two arrays, one which specifies which 
columns from the metadata query to present, and the second which contains the 
width at which to print the corresponding column. These arrays could then be 
set appropriately from the show* methods in ij.jj as needed. Then you could 
alter JDBCDisplayUtil so that when it takes an ijResultSetResult to display, it 
gets the arrays it should display from the columns array of the 
ijResultSetResult (or all columns if the column array is null), and only 
displays them at the width specified in the second array (or the default width 
if no width is specified in the second array). I realize that this could end up 
being a fair piece of work, but it might be worth the effort. Does anyone else 
have any good ideas (meaning simpler) for presenting the results nicely?

Satheesh, the change to the metadata query looks ok. Is there a reason why 
synonyms where not added to the results returned by getTableTypes() earlier?

> 'show tables' and 'describe' commands in ij
> -------------------------------------------
>
>          Key: DERBY-1164
>          URL: http://issues.apache.org/jira/browse/DERBY-1164
>      Project: Derby
>         Type: New Feature

>   Components: Tools
>     Reporter: Håvard Mork
>     Priority: Trivial
>  Attachments: 1164.diff, 1164_2.diff, 1164_3.diff
>
> New users migrating from mysql are familiar with commands 'show tables' and 
> 'describe'  to respectively display all permanent tables, and show fields in 
> a given table. These are not standard sql, but I suggest to implement them 
> only in the IJ tool for user-friendliness.
> As suggested in db-dev, using DatabaseMetaData should provide the necessary 
> query strings.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to