How to set the database? #9051
-
Hey. Simple question, but can't find ANY documentation on this anywhere, which is super weird. How do you tell the ORM to use the database named "whatever"?? Normally (eg with PDO) I would expect to pass that in the connection settings, but doing so - using the same format as PDO, doesn't set the database name and so I'm left with a bunch of exceptions because I have "No database selected"... |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
The connection is not the concern of the ORM, maybe that's why you could not find docs about it? Here are the DBAL docs about this: https://www.doctrine-project.org/projects/doctrine-dbal/en/current/reference/configuration.html#configuration |
Beta Was this translation helpful? Give feedback.
-
Is it the DBAL that provisions the database based on the Entity models? Cause from where I'm sitting it looks like it should be the ORM itself, and when I run vendor/bin/doctrine |
Beta Was this translation helpful? Give feedback.
-
Found my answer (and it doesn't involve DBAL): The parameter I had for "database name" in the configuration array passed to |
Beta Was this translation helpful? Give feedback.
Found my answer (and it doesn't involve DBAL):
The parameter I had for "database name" in the configuration array passed to
EntityManager::create()
was usingname
instead ofdbname
.