In PhpStorm can i omit the datbase name from a sql view DDL ?

If i open a view and select DDL i get something like this:

CREATE VIEW myview AS
SELECT
`t`.`FOO` AS `FOO`,
`t`.`BAR` AS `BAR`,
FROM `mydatabase`.`mytable` `t`

Is there an option through which i can omit the database name in the DDL, to get something like:

CREATE VIEW myview AS
SELECT
`t`.`FOO` AS `FOO`,
`t`.`BAR` AS `BAR`,
FROM `mytable` `t`

Thanks

0
6 comments
Avatar
Permanently deleted user

Hi,

Go to Settings\Preferences | Languages & Frameworks | SQL Resolution Scopes and set the desired schema to be default one.

Also check if dialect in Languages & Frameworks | SQL Dialects is configured correctly.

0

Thanks Vladirmir. The mysql dialect was already configured, i've set the 'project mapping' to the desired schema in 'SQL Resolution Scopes' but the view DDL still have the database prefix

From what you're saying i've undestood that there is the possibility to omit the database name, so what else can i try ? 

0

I don't think this can be configured: I didn't find any options for that. 

0

Strange thing is i don't see the prefix in tables and routines DDL, only for views. Maybe i should add a ticket to the issue tracker ?

0
Avatar
Permanently deleted user

Sorry for the confusion, looks like it is actual for views indeed. Adding the ticket to database project at http://youtrack.jetbrains.com/issues/DBE#newissue=yes seems to be a good idea.

0

i've just created an issue. For anyone interested:

https://youtrack.jetbrains.com/issue/DBE-4780 

1

Please sign in to leave a comment.