This commit is contained in:
2021-12-06 16:12:53 +08:00
parent f75457b18a
commit 8be23dd4c7
+7 -1
View File
@@ -197,6 +197,13 @@ class Connection extends Component
*/
public function masterInstance(): PDO
{
var_dump([
'cds' => $this->cds,
'username' => $this->username,
'password' => $this->password,
'attributes' => $this->attributes,
'dbname' => $this->database
]);
return $this->connections()->get([
'cds' => $this->cds,
'username' => $this->username,
@@ -212,7 +219,6 @@ class Connection extends Component
*/
public function slaveInstance(): PDO
{
var_dump($this->slaveConfig);
if (empty($this->slaveConfig) || Db::transactionsActive()) {
return $this->masterInstance();
}