Skip to content

Commit ae05e49

Browse files
committed
wip
1 parent 9bb41a6 commit ae05e49

File tree

1 file changed

+59
-59
lines changed

1 file changed

+59
-59
lines changed

src/Illuminate/Database/Connectors/PostgresConnector.php

Lines changed: 59 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -50,65 +50,6 @@ public function connect(array $config)
5050
return $connection;
5151
}
5252

53-
/**
54-
* Set the connection transaction isolation level.
55-
*
56-
* @param \PDO $connection
57-
* @param array $config
58-
* @return void
59-
*/
60-
protected function configureIsolationLevel($connection, array $config)
61-
{
62-
if (isset($config['isolation_level'])) {
63-
$connection->prepare("set session characteristics as transaction isolation level {$config['isolation_level']}")->execute();
64-
}
65-
}
66-
67-
/**
68-
* Set the timezone on the connection.
69-
*
70-
* @param \PDO $connection
71-
* @param array $config
72-
* @return void
73-
*/
74-
protected function configureTimezone($connection, array $config)
75-
{
76-
if (isset($config['timezone'])) {
77-
$timezone = $config['timezone'];
78-
79-
$connection->prepare("set time zone '{$timezone}'")->execute();
80-
}
81-
}
82-
83-
/**
84-
* Set the "search_path" on the database connection.
85-
*
86-
* @param \PDO $connection
87-
* @param array $config
88-
* @return void
89-
*/
90-
protected function configureSearchPath($connection, $config)
91-
{
92-
if (isset($config['search_path']) || isset($config['schema'])) {
93-
$searchPath = $this->quoteSearchPath(
94-
$this->parseSearchPath($config['search_path'] ?? $config['schema'])
95-
);
96-
97-
$connection->prepare("set search_path to {$searchPath}")->execute();
98-
}
99-
}
100-
101-
/**
102-
* Format the search path for the DSN.
103-
*
104-
* @param array $searchPath
105-
* @return string
106-
*/
107-
protected function quoteSearchPath($searchPath)
108-
{
109-
return count($searchPath) === 1 ? '"'.$searchPath[0].'"' : '"'.implode('", "', $searchPath).'"';
110-
}
111-
11253
/**
11354
* Create a DSN string from a configuration.
11455
*
@@ -171,6 +112,65 @@ protected function addSslOptions($dsn, array $config)
171112
return $dsn;
172113
}
173114

115+
/**
116+
* Set the connection transaction isolation level.
117+
*
118+
* @param \PDO $connection
119+
* @param array $config
120+
* @return void
121+
*/
122+
protected function configureIsolationLevel($connection, array $config)
123+
{
124+
if (isset($config['isolation_level'])) {
125+
$connection->prepare("set session characteristics as transaction isolation level {$config['isolation_level']}")->execute();
126+
}
127+
}
128+
129+
/**
130+
* Set the timezone on the connection.
131+
*
132+
* @param \PDO $connection
133+
* @param array $config
134+
* @return void
135+
*/
136+
protected function configureTimezone($connection, array $config)
137+
{
138+
if (isset($config['timezone'])) {
139+
$timezone = $config['timezone'];
140+
141+
$connection->prepare("set time zone '{$timezone}'")->execute();
142+
}
143+
}
144+
145+
/**
146+
* Set the "search_path" on the database connection.
147+
*
148+
* @param \PDO $connection
149+
* @param array $config
150+
* @return void
151+
*/
152+
protected function configureSearchPath($connection, $config)
153+
{
154+
if (isset($config['search_path']) || isset($config['schema'])) {
155+
$searchPath = $this->quoteSearchPath(
156+
$this->parseSearchPath($config['search_path'] ?? $config['schema'])
157+
);
158+
159+
$connection->prepare("set search_path to {$searchPath}")->execute();
160+
}
161+
}
162+
163+
/**
164+
* Format the search path for the DSN.
165+
*
166+
* @param array $searchPath
167+
* @return string
168+
*/
169+
protected function quoteSearchPath($searchPath)
170+
{
171+
return count($searchPath) === 1 ? '"'.$searchPath[0].'"' : '"'.implode('", "', $searchPath).'"';
172+
}
173+
174174
/**
175175
* Configure the synchronous_commit setting.
176176
*

0 commit comments

Comments
 (0)