8000 Update dbal.rst by bpiepiora · Pull Request #3944 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

Update dbal.rst #3944

8000
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
wants to merge 1 commit into from
Closed

Update dbal.rst #3944

wants to merge 1 commit into from

Conversation

bpiepiora
Copy link
Contributor

The SchemaTool throws an error if mapping_types are configured under default.connection. If configured under dbal everything works fine.

The SchemaTool throws an error if mapping_types are configured under default.connection. If configured under dbal everything works fine.
@stof
8000
Copy link
Member
stof commented Jun 13, 2014

it's all a matter of using the expanded syntax or the shortcut syntax for a single connection.

@bpiepiora
Copy link
Contributor Author

okay, is it possible to give another example for new symfony developers? with the default configuration the example doesn't work:

error while generating mapping

doctrine:
    dbal:
        driver:   "%database_driver%"
        host:     "%database_host%"
        port:     "%database_port%"
        dbname:   "%database_name%"
        user:     "%database_user%"
        password: "%database_password%"
        charset:  UTF8
        connections:
            default:
                mapping_types:
                    enum: string

mapping works

doctrine:
    dbal:
        driver:   "%database_driver%"
        host:     "%database_host%"
        port:     "%database_port%"
        dbname:   "%database_name%"
        user:     "%database_user%"
        password: "%database_password%"
        charset:  UTF8

        mapping_types:
            enum: string

@stof
Copy link
Member
stof commented Jun 13, 2014

this is because your first example is a mix of the shortcut and expanded syntaxes, not a usage of one of them.
there is already an issue somewhere about documenting better both syntaxes, but it should be done in the whole Doctrine section, and probably not by removing the expanded syntax entirely

@bpiepiora
Copy link
Contributor Author

i really need to get deeper into that configuration stuff! 😄
thanks for your time and i hope some guy has the time to document both syntaxes!

@weaverryan
Copy link
Member

This relates also to doctrine/DoctrineBundle#299. We've had a few issues lately with people getting confused by the 2 syntaxes, so you're not alone! I think there is probably something we can do in the documentation, but I would like a better error message in the code itself (since you can't use the expanded syntax and the short syntax, you can only choose one - but we should be able to detect if you're trying to use both).

I do think we typically document the short syntax (not the expanded), so I would actually be a +1 for merging this, perhaps with a note about the expanded syntax.

@wouterj
Copy link
Member
wouterj commented Aug 15, 2014

+1 too

@weaverryan
Copy link
Member

Merged - thanks Benjamin! I'm also going to add a small note about the extended syntax.

weaverryan added a commit that referenced this pull request Aug 16, 2014
* 2.3: (35 commits)
  use relative path to page
  fix xml to specify a method
  replaced old way of specifying http method by the new one
  Fixing a mistake
  Fix use mistakes.
  [#3944] Tiny addition to mention multiple connections
  Update dbal.rst
  [#3888] Changing base template title back
  [Components] consistent & complete config examples
  Fixed typos
  Added link to JSFiddle example
  some minor improvements
  describe the usage of the RegisterListenersPass
  Update deployment-tools.rst
  Rewrote Extension & Configuration docs
  add order of translation formats
  Fix class name in ConsoleTerminateListener example
  [Book] consistent and complete config examples
  added Github teams for the core team
  [book][cache][tip] added cache annotations.
  ...
weaverryan added a commit that referenced this pull request Aug 16, 2014
* 2.4: (38 commits)
  use relative path to page
  fix xml to specify a method
  replaced old way of specifying http method by the new one
  Fixing a mistake
  Fix use mistakes.
  [#3944] Tiny addition to mention multiple connections
  Update dbal.rst
  [#3888] Changing base template title back
  [Components] consistent & complete config examples
  Check for api_key in request
  Update api_key_authentication.rst - POST Method
  Fixed typos
  Added link to JSFiddle example
  some minor improvements
  describe the usage of the RegisterListenersPass
  Update deployment-tools.rst
  Rewrote Extension & Configuration docs
  add order of translation formats
  Fix class name in ConsoleTerminateListener example
  Fixed the code snippets for the expression language functions
  ...
weaverryan added a commit that referenced this pull request Aug 16, 2014
* 2.5: (39 commits)
  use relative path to page
  fix xml to specify a method
  replaced old way of specifying http method by the new one
  Fixing a mistake
  Fix use mistakes.
  [#3944] Tiny addition to mention multiple connections
  Update dbal.rst
  [#3888] Changing base template title back
  [Components] consistent & complete config examples
  Check for api_key in request
  Update api_key_authentication.rst - POST Method
  Fixed typos
  Fixed typos
  Added link to JSFiddle example
  some minor improvements
  describe the usage of the RegisterListenersPass
  Update deployment-tools.rst
  Rewrote Extension & Configuration docs
  add order of translation formats
  Fix class name in ConsoleTerminateListener example
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0