Skip to content

sql-sync should validate aliases #3103

@danepowell

Description

@danepowell

If you run sql-sync with an invalid alias (i.e. drush sql-sync @foo.remote @foo.local, where @foo.remote isn't a valid alias), you get an obscure error:

PHP Fatal error: Uncaught TypeError: Argument 1 passed to Drush\Commands\sql\SqlSyncCommands::databaseName() must be an instance of Drush\SiteAlias\AliasRecord, boolean given,

This looks like a bug, but in fact is just Drush's way of telling you that you are using an invalid alias.

Ideally sql-sync would validate the provided aliases and provide a more helpful error message, such as if you provide an invalid alias to drush si:

The alias @foo.remote could not be found.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions