-
-
Notifications
You must be signed in to change notification settings - Fork 119
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
Make DynamicDatabaseConnection static #898
base: main
Are you sure you want to change the base?
Make DynamicDatabaseConnection static #898
Conversation
We should get rid of |
What about any logic for generating the connection config? This is just an example from my initial commit, but I needed to get a few different default values depending on the driver. |
Do we even need to set the charset and collation? |
I have no idea. Postgres almost certainly doesn't need it, but the one thing that is really important is the default database. On postgres, you usually want to test a connection by connecting to Edit: This is kind of not entirely the correct way to do it either, but it's a limitation by Laravel. You should be able to connect to the server with no database specified, but Laravel requires it. Edit: I realized, I'm already planning on making an enum for the driver types, and the enum will store the default database as a property. So it's not that big of a deal to just get rid of this. |
What about something like this? These are just some things I was trying out, I'm not sure what would be best. I tried to move all the defaults to a central place where they can be referenced fairly easily from anywhere else, instead of redefining them all over the place. |
I thought it was odd that this class, which has no internal state or anything, wasn't a static method and required instantiating the class first.
Does this seem reasonable to change, or is there some plan for it?