I have some code with some queries in it, in which the table is not recognized. I've tried several settings and I just don't understand what I'm supposed to do to make it work.
I my setup I have a lot of *global* database sources, both mysql and postgresql.
Here's an example of code that czn't resolve the table name :
This is the error message :
Clicking on "Choose shema" does nothing. Clicking on "Choose schema" in this menu does also nothing; Note that if offers to "edit mysql fragment" but here I'm connecting to a postgresql database.
If I "Go to SQL Resolution Scopes" I get :
Here I have tried :
- Setting only the public shema on the test database on the local server
- Setting "All databases on the local server"
- Setting "All datasources"
None of those tries seem to trigger any change, "Choose schema" doesn't work.
At some point "Choose schema" did offer me something, but it was only a list of Mysql datasources, confirming that Pycharm seems to belive I'm using mysql here (but this code is for a postgresql database.) and this is my config for SQL Dialects :
Note that changing "Global SQL Dialect" to PostgreSQL doesn't change anything.
If I "Edit Mysql Fragment" Code Pycharm really think it's a Mysql fragment :
Now if I change Mysql to Postgresql it changes :
But If I select a session opened on the right database, now it doesn't work again :
Although the table really exists and is recognized in the console :
So I'm a bit lost here, why does it have to be so complicated ?