Skip to content

Don't switch schema if you check if it exists before #1

Description

@aliasdoc

Hi, I have an application which use two connections:

  • MySQL for local needs (connection "mysql")
  • PostgreSQL for getting remote data (connection "psql_tunnel")

I use your package to work with my psql_tunnel connection, when I switch schema it work but if I make a check before it doesn't.

if (PGSchema::schemaExists('xxxx'.$tenant, env('xxxx', 'pgsql_tunnel'))) {
    PGSchema::schema('xxxx'.$tenant, env('xxxx', 'pgsql_tunnel'));
} else {
    dd('schema does not exists');
}

if I switch without check, it works:
PGSchema::schema('xxxx'.$tenant, env('xxxx', 'pgsql_tunnel'));

Thank you.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions