Menu

#600 Class SQLDatabaseMetaData: Trim SQLKeywords etc.

SQuirreL
closed
nobody
None
medium
2021-04-12
2021-04-07
Chris B
No

I found that getSQLKeywords() for Oracle metadata returns a String with a list like this:

ACCESS, ADD, ALTER, AUDIT, CLUSTER, COLUMN, ...

Please note the spaces in between.
On the "Keywords" tab in Squirrel this results in a list like this:

" ADD"
" ALTER"
" AUDIT"
:
"ACCESS"

So most of the keywords are displayed with a leading space.
And "ACCESS" - the only keyword without leading space - is sorted to the end of the list.

I think an easy solution would be to modify makeArray(...) in class net.sourceforge.squirrel_sql.fw.sql.SQLDatabaseMetaData to trim each item:

list.add(st.nextToken().trim());

This would also affect "NumericFunctions", "StringFunctions", etc.
(The Oracle metadata had no leading spaces for those.
But I cant't see a real disadvantage to always trim.
... just in case that any other DB makes use of leading or trailing spaces as well.)

What do you think ?

Discussion

  • Gerd Wagner

    Gerd Wagner - 2021-04-12
    • status: open --> closed
     
  • Gerd Wagner

    Gerd Wagner - 2021-04-12

    Fixed in our Git repository. Will be available in future snapshots and versions.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.