Assigning Datasource to Module only
Answered
Hi,
it would be very helpful, if it would be possible to assign a data source only to a module instead of the whole project.
Please sign in to leave a comment.
Could you please elaborate why do you think so? Thanks.
I have an application project which is connected to our companies CMS. This project contains many modules.
Now the company is changing its CMS to a completely new one. So I have to adapt the modules which containing the interfaces to the CMS.
Because the structure of the new CMS is totally different to the old one I have to setup a new database for my application used from this interfaces. Many of the tables can still be the same and others only have to change a few columns. So I don't want to rename all tables to be sure that Intelliji is finding the right one.
For example:
Old Database contains the table pm_jobs. In this table I have a column fe_id.
The new database contains the same table but the column fe_id is replaced by the column fe_sso.
Because the application uses different databases for different modules of the application (the database name is created dynamically on a users choice) I cannot hardcode a database name in the queries. Now Intelliji is not able to find the matching table in the corresponding module.
>Now Intelliji is not able to find the matching table in the corresponding module.
Could you please clarify the problem in more details?
>Because the application uses different databases for different modules of the application (the database name is created dynamically on a users choice)
You can give the IDE data source any name you want when creating it.
Also you can assign each data source (or even set of tables/schemas) its own color - to visually better distinguish between data sources/tables.
>Now Intelliji is not able to find the matching table in the corresponding module.
If there is an issue with matching the data source to a specific code - you can manage it in Settings (Preferences on macOS) | Languages & Frameworks | SQL Resolution Scopes | Languages & Frameworks | SQL Resolution Scopes.
Hi Andrey
Great, that is exact what I was looking for.
Thanks a lot
Claus