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

Custom Driver Options in DSN URL #5293

Closed
mvorisek opened this issue Feb 23, 2022 · 3 comments
Closed

Custom Driver Options in DSN URL #5293

mvorisek opened this issue Feb 23, 2022 · 3 comments

Comments

@mvorisek
Copy link
Contributor

This is a question.

Based on https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#custom-driver-options driverOptions can be used to specify driver specific options.

For MSSQL I need to specify TrustServerCertificate=1. How can I specify such option in DSN URL so it is parsed correctly to driverOptions array?

@morozov
Copy link
Member

morozov commented Feb 23, 2022

Something like this may work according to DriverManagerTest::testDatabaseUrl():

'Driver Options' => [
    [
        'url' => 'sqlsrv://localhost/foo?driverOptions[TrustServerCertificate]=1',
    ],
    [
        'driverOptions' => [
            'TrustServerCertificate' => 1,
        ],
    ],
],

@mvorisek
Copy link
Contributor Author

Works like a charm, thank you!

@morozov morozov closed this as not planned Won't fix, can't repro, duplicate, stale Jul 15, 2022
@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants