8000 [Messenger] Doctrine Transport not compatible with SQL Server · Issue #32585 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
8000

[Messenger] Doctrine Transport not compatible with SQL Server #32585

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

Closed
dlegatt opened this issue Jul 17, 2019 · 0 comments
Closed

[Messenger] Doctrine Transport not compatible with SQL Server #32585

dlegatt opened this issue Jul 17, 2019 · 0 comments

Comments

@dlegatt
Copy link
dlegatt commented Jul 17, 2019

Symfony version(s) affected: 4.3.2

Description
Doctrine DBAL throws the following exception when using messenger with the Doctrine transport and a SQL Server database.

sqlsrv does not support named parameters to queries, use question mark (?) placeholders instead.

How to reproduce
Create a new symfony project and install messenger:

symfony new messenger-doctrine-sqlsrv --full
cd messenger-doctrine-sqlsrv
composer req messenger

Configure .env for the database DSN and messenger transport DSN

.
.
DATABASE_URL=sqlsrv://sa:Password01@127.0.0.1/test_db
.
.
MESSENGER_TRANSPORT_DSN=doctrine://default
.

Configure messenger.yaml

framework:
    messenger:
        transports:
             async: '%env(MESSENGER_TRANSPORT_DSN)%'
.
.

Configure doctrine.yaml

doctrine:
    dbal:
        driver: 'sqlsrv'
        charset: UTF-8
        default_table_options:
            charset: UTF-8
.
.

From the terminal, run ./bin/console messenger:consume

@dlegatt dlegatt changed the title Messenger Doctrine Transport not compatible with SQL Server [Messenger] Doctrine Transport not compatible with SQL Server Jul 17, 2019
@fabpot fabpot closed this as completed Aug 5, 2019
fabpot added a commit that referenced this issue Aug 5, 2019
… placeholders for sqlsrv compatibility (David Legatt)

This PR was squashed before being merged into the 4.3 branch (closes #32836).

Discussion
----------

[Messenger] Removed named parameters and replaced with `?` placeholders for sqlsrv compatibility

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #32585
| License       | MIT
| Doc PR        |

I edited the Doctrine Transport Connection class to use `?` placeholders in the query builder instead of named repositories as this resulted in a compatibility issue with SQL Server.

Commits
-------

fc0e4ba [Messenger] Removed named parameters and replaced with `?` placeholders for sqlsrv compatibility
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants
0