Smart(er) SQL completion based on table relationships


The SQL code completion provided by IDEA 8.x is quite nice.

For example, completing "uCD" to "user_creation_date" column name makes
typing queries a pleasure.

The "Datasource" model created by IDEA includes primary key and foreign
key information for all tables. It seems it would be possible to make
SQL completion even more fluid.

Let's assume I'm writing a query that joins some tables:
---
select *
from USER u, USER_DETAILS ud
where u.id = ud.]]>
---
Table USER_DETAILS (aliased to "ud") has a foreign key to table USER
(aliased to "u").

It would be a nice touch if smart completion (Ctrl-Shift-Space) would
use the table relation metadata to suggest matching the foreign key to
the primary key in this WHERE clause expression.

-tt

2 comments
Comment actions Permalink

Here's the feature request:
http://www.jetbrains.net/jira/browse/IDEA-19908

Feel free to comment and/or vote.

-tt

0
Comment actions Permalink

Another nice feature request is to have Ctrl-P support for INSERT
statements.

When looking at an "INSERT INTO table_name values (...)", IDEA could
show what column the current value will end up in.

Add comments/votes here:
http://www.jetbrains.net/jira/browse/IDEADEV-36088

-tt

0

Please sign in to leave a comment.