Skip to content

Commit cca943d

Browse files
committed
Use persistent connection
1 parent 00ced51 commit cca943d

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

src/Tqdev/PhpCrudApi/Database/GenericDB.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ private function getOptions(): array
4545
$options = array(
4646
\PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION,
4747
\PDO::ATTR_DEFAULT_FETCH_MODE => \PDO::FETCH_ASSOC,
48+
\PDO::ATTR_PERSISTENT => true,
4849
);
4950
switch ($this->driver) {
5051
case 'mysql':return $options + [

tests/fixtures/blog_mysql.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,4 +159,6 @@ CREATE TABLE `kunsthåndværk` (
159159
INSERT INTO `kunsthåndværk` (`id`, `Umlauts ä_ö_ü-COUNT`) VALUES
160160
('e42c77c6-06a4-4502-816c-d112c7142e6d', 1);
161161

162+
SET foreign_key_checks = 1;
163+
162164
-- 2016-11-05 13:11:47

0 commit comments

Comments
 (0)