Is use statement superfluous in MySqlConnector? #44469
Unanswered
Dachande663
asked this question in
Q&A
Replies: 1 comment
-
I think no. I've been using a modified MySqlConnector for years without issues. You can bind a new class to "db.connector.mysql" and override some methods, "connect" in particular. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
When MySQL connects to MySQL via a PDO DSN, the dbname value is provided. However, on L27, Laravel executes a USE statement to select the datatbase again. This means all connections result in an extra statement been sent, which has a non-zero latency for any network-based architecture.
Is there a need for the USE statement? Removing it does not affect any tests as far as I can see.
framework/src/Illuminate/Database/Connectors/MySqlConnector.php
Line 27 in 03795ab
Beta Was this translation helpful? Give feedback.
All reactions