Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use platformName to determine db type #1212

Merged
merged 2 commits into from
Jun 20, 2021

Conversation

stockalexander
Copy link
Contributor

Use platformName instead of default connection name to determine used dbms. Previous solution isn't working, when custom names are used.

This should fix the problem mentioned in #480 for custom connection names, too. Example config/database.php section:

'default' => env('DB_CONNECTION', 'main_db'),
'connections' => [
    'main_db' => [
        'driver' => 'mysql',
        'host' => env('DB_HOST_MAIN', '127.0.0.1'),
        'port' => env('DB_PORT_MAIN', '3306'),
        'database' => env('DB_DATABASE_MAIN', ''),

...

stockalexander and others added 2 commits April 13, 2021 22:21
…n name to determine used dbms. Previous solution isn't working, when multiple connections with custom names are used.
Copy link
Collaborator

@mfn mfn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfectly makes sense to me!

Pure luck it worked in most cases. I also checked that the platform names returned from DBAL match the existing case statements and added a changelog entry.

Thank you!

@mfn mfn requested a review from barryvdh April 14, 2021 05:14
@barryvdh barryvdh merged commit af84c78 into barryvdh:master Jun 20, 2021
d3v2a pushed a commit to d3v2a/laravel-ide-helper that referenced this pull request Feb 16, 2024
* Use current connection platform (driver) instead of default connection name to determine used dbms. Previous solution isn't working, when multiple connections with custom names are used.

* chore: add changelog

Co-authored-by: Markus Podar <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants