Database autocomplete includes database name

When writing MySQL queries in Phpstorm, the autocomplete has begun including the database name when a table name is selected in the code completion window. Also, sometimes--though oddly not every time--when selecting a column name, the database name and table name are included. I do have multiple data sources, however they are all the same schema (Production database, replica, development database). This began happening about 2 months or so ago, and though I can't point to a specific build, it seemed to have started happening after an update. To reiterate, table names are autocompleted in this format "database_name.table_name" and columns are sometimes autocompleted in this format "database_name.table_name.column_name".

1
3 comments

Hi there,

I believe it has to do with the fact that you have multiple databases (especially because they have the same structure).

Please specify correct scope in "Settings/Preferences | Languages & Frameworks | SQL Resolution Scopes" (choose the most desired DB) -- it can be project-wide or on per file/folder basis.

I just run simple test with 2 basic Laravel databases (standard "users" table) -- once I specified one of them as default (for whole project) it started inserting just "users" in "SELECT * FROM " statement.

10
Avatar
Permanently deleted user

That did it! First time using JetBrains support. Very impressed with the speed and accuracy of the answer. Thanks a lot!

1

Please sign in to leave a comment.