Choose which schema a query is written against?

I have a project that uses two databases. When I write a query against the second database, Pycharm complains that it can't resolve tables and fields that I've written into the query. When I do Alt+Enter on the offending query, one of the link options is "Choose Schema" but it doesn't do anything. How can I link up a query with a particular schema so that Pycharm can properly check my field and table names?

0
3 comments
Avatar
Yuriy Vinogradov

Please set up SQL resolution scopes and  SQL Dialects - will it help? 

0

Same issue here : I often need to query 2 differents database (a MySQL one and an SQL Server one) in the same file.
But when I try to associate a schema with a query (via the “Choose schema” dropdown), only the MySQL databases are shown.

How can I associate a schema PER query in the same file ???
Specifying an SQL resolution scope doesn't seem to change anything.

0
Hi Cedric,

No plans to implement such feature. You need to reattach the connection to a schema in your SQL File if you have 2 or more different databases.
0

Please sign in to leave a comment.