This Question is Answered

1 "helpful" answer available (2 pts)
9 Replies Last post: Mar 24, 2010 6:55 PM by Alexey Gopachenko  
Dmitriy Zavalkin Novice 242 posts since
Nov 11, 2009
Currently Being Moderated

Mar 20, 2010 12:29 AM

How to invoke autocomplete for table names (from data source) in .sql file?

I setted up Data Source (MySQL, local server, root username/password). I have autocomplete for tables names in database console tab. How I can get autocomplete at least for tables names in .sql files?

Both Ctrl+Space and Shift+Ctrl+Space deosn't help. See image below.

sql_file_no_autocomplete_for_tables.png

P.S.

OS: Win 7 x32;
JDK: 1.6.0_18-b07;

MySQL: 5.0.45-community-nt;

WebIDE(PhpStorm): from 94.583 down to 94.5 or even to more old versions.

drian  Newbie 29 posts since
Mar 10, 2010
Currently Being Moderated
Mar 20, 2010 12:51 AM in response to: Dmitriy Zavalkin
Re: How to invoke autocomplete for table names (from data source) in .sql file?

Please check my answer in this post. I use DB navigator for mysql databases and autocomplete works ok.

 

http://www.jetbrains.net/devnet/thread/287297?tstart=0

Gregory Shrago JetBrains 220 posts since
Mar 27, 2006
Currently Being Moderated
Mar 22, 2010 8:36 PM in response to: Dmitriy Zavalkin
Re: How to invoke autocomplete for table names (from data source) in .sql file?

All the tables are in "reduinda_work" database (schema/catalog) which is not imported by default.

So you have to do any of the following:

  • specify "<database>." before each table reference and there will be completion after dot
  • use MySQL "use" statement, i.e. "use <database>;"
  • have "/<database>" part in the Database URL property of the DataSource, i.e. jdbc:mysql://<host>/<database>

 

The third variant is the best for MySQL.

 

BTW it seems that SQL Resolve inspection is turned off because all the tables in the file should be yellow.

Gregory Shrago JetBrains 220 posts since
Mar 27, 2006
Currently Being Moderated
Mar 22, 2010 9:32 PM in response to: Dmitriy Zavalkin
Re: How to invoke autocomplete for table names (from data source) in .sql file?

Please ensure that MySQL dialect is configured in Settings/SQL Dialects.

The Generic dialect provides only keyword highlighing and completion so this setting may be the cause of the problem.

If this is not the case then I have to ask some more questions:

 

Does "Go to declaration" (Ctrl+B) works on `se_languagevars` for example?

Do you have completion in the following sample queries:

"select * from reduinda_<caret-here>"

"select * from reduinda_work.<caret-here>

 

As far as inspections are concerned the "highlighting level" popup is not enough. You should check whether the SQL inspections are turned on in the inspection profile settings. To check the profile just click on the "Configure Inspections" link that is located under the "Highlighting Level" slider.

Gregory Shrago JetBrains 220 posts since
Mar 27, 2006
Currently Being Moderated
Mar 23, 2010 12:51 AM in response to: Dmitriy Zavalkin
Re: How to invoke autocomplete for table names (from data source) in .sql file?

This problem is unrelated to SQL or Database functionality.

Please use built in error reporting tool or post this trace in tracker.

Make sure you have the latest EAP installed and/or wait for the next one.

Alexey Gopachenko JetBrains 1,462 posts since
Aug 22, 2002
Currently Being Moderated
Mar 24, 2010 6:55 PM in response to: Dmitriy Zavalkin
Re: How to invoke autocomplete for table names (from data source) in .sql file?

There may be various reasons. Anyway we do our best to make it available.

More Like This

  • Retrieving data ...