18
18
use ClickHouseDB \Exception \ClickHouseException ;
19
19
use Doctrine \DBAL \Driver \Connection ;
20
20
use Doctrine \DBAL \Driver \Result ;
21
- use Doctrine \DBAL \Driver \ServerInfoAwareConnection ;
22
21
use Doctrine \DBAL \Driver \Statement ;
23
- use Doctrine \DBAL \Exception ;
24
- use Doctrine \DBAL \ParameterType ;
25
22
use Doctrine \DBAL \Platforms \AbstractPlatform ;
26
23
24
+ use Doctrine \DBAL \Platforms \Exception \NotSupported ;
27
25
use function array_merge ;
28
26
29
- class ClickHouseConnection implements Connection, ServerInfoAwareConnection
27
+ class ClickHouseConnection implements Connection
30
28
{
31
29
protected Client $ client ;
32
30
@@ -69,13 +67,9 @@ public function query(string $sql): Result
69
67
/**
70
68
* {@inheritDoc}
71
69
*/
72
- public function quote ($ value , $ type = ParameterType:: STRING )
70
+ public function quote (string $ value ): string
73
71
{
74
- if ($ type === ParameterType::STRING ) {
75
- return $ this ->platform ->quoteStringLiteral ($ value );
76
- }
77
-
78
- return $ value ;
72
+ return $ this ->platform ->quoteStringLiteral ($ value );
79
73
}
80
74
81
75
/**
@@ -89,33 +83,33 @@ public function exec(string $sql): int
89
83
/**
90
84
* {@inheritDoc}
91
85
*/
92
- public function lastInsertId ($ name = null )
86
+ public function lastInsertId (): int | string
93
87
{
94
- throw Exception:: notSupported (__METHOD__ );
88
+ throw NotSupported:: new (__METHOD__ );
95
89
}
96
90
97
91
/**
98
92
* {@inheritDoc}
99
93
*/
100
- public function beginTransaction (): bool
94
+ public function beginTransaction (): void
101
95
{
102
- throw Exception:: notSupported (__METHOD__ );
96
+ throw NotSupported:: new (__METHOD__ );
103
97
}
104
98
105
99
/**
106
100
* {@inheritDoc}
107
101
*/
108
- public function commit (): bool
102
+ public function commit (): void
109
103
{
110
- throw Exception:: notSupported (__METHOD__ );
104
+ throw NotSupported:: new (__METHOD__ );
111
105
}
112
106
113
107
/**
114
108
* {@inheritDoc}
115
109
*/
116
- public function rollBack (): bool
110
+ public function rollBack (): void
117
111
{
118
- throw Exception:: notSupported (__METHOD__ );
112
+ throw NotSupported:: new (__METHOD__ );
119
113
}
120
114
121
115
/**
@@ -129,4 +123,9 @@ public function getServerVersion(): string
129
123
return '' ;
130
124
}
131
125
}
126
+
127
+ public function getNativeConnection ()
128
+ {
129
+ return $ this ;
130
+ }
132
131
}
0 commit comments