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?
请先登录再写评论。
Hello Mike,
Please, check the SQL dialect assigned to the file. E.g. in Settings / SQL
dialects.
"Generic SQL" does not provide table/column completion.
Alexander.
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.
Hello Mike,
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.