New SQL Code Assist doesn't do column/table names

Trying out the new 'Database' tab and its functions.

I'm looking at a java source file that contains SQL statements.  I see they're now highlighted green, which I assume means that IDEA recognizes this as "this is SQL" and I'll get the SQL code assist things? So I'm inside that string and I hit ctrl-space and I get a huge popup list of SQL keywords (ok, fine).   But where's the table and column names?

As talked about here: http://www.jetbrains.com/idea/features/sql.html

Do the table/column names only come up inside *.sql files?

I've tried in that type of file as well, but I'm actually getting less joy there.  No highlighting even.  I must have something configured incorrectly.  Any help?

3 comments
Comment actions Permalink

Hello Mike,

Trying out the new 'Database' tab and its functions.

I'm looking at a java source file that contains SQL statements. I see
they're now highlighted green, which I assume means that IDEA
recognizes this as "this is SQL" and I'll get the SQL code assist
things? So I'm inside that string and I hit ctrl-space and I get a
huge popup list of SQL keywords (o

k, fine). But where's the table and column names?

As talked about here: http://www.jetbrains.com/idea/features/sql.html

Do the table/column names only come up inside *.sql files?

I've tried in that type of file as well, but I'm actually getting less
joy there. No highlighting even. I must have something configured
incorrectly. Any help?

---
Original message URL:
http://www.jetbrains.net/devnet/message/5228090#5228090


Please, check the SQL dialect assigned to the file. E.g. in Settings / SQL
dialects.

"Generic SQL" does not provide table/column completion.

Alexander.


0
Comment actions Permalink

Thanks Alexander, that helped a bit.   It led me to re-install IntelliJ 8, without importing old settings.  And even then, under File Types, the *.sql was under text files.  The only mapping to SQL was *.ddl.  After fixing that, I get my highlighting.   But still no table/column names.

Where does one specify that "for this file/directory/project, one should use *this* datasource" ?  Or does it somehow magically find it? If so, what if one has multiple datasources, or some datasource saved at a global level?

Thanks for your help.

0
Comment actions Permalink

Hello Mike,

Where does one specify that "for this file/directory/project, one
should use this datasource" ? Or does it somehow magically find it?
If so, what if one has multiple datasources, or some datasource saved
at a global level?

Thanks for your help.

---
Original message URL:
http://www.jetbrains.net/devnet/message/5228184#5228184


Nowhere, at the moment. Currently IDEA tries to resolve a symbol typed in
.sql file into all data sources. Once matching element is found in any data
source, it is resolved.

The feature of "mapping" particular .sql to particular data source was discussed
(e.g. http://www.jetbrains.net/jira/browse/IDEADEV-30139), but not yet implemented.
It seems that there is no open JIRA issue about this.

Alexander.




0

Please sign in to leave a comment.