@@ 190-201 (lines=12) @@ | ||
187 | * @param bool $useReadPdo |
|
188 | * @return array |
|
189 | */ |
|
190 | public function select($query, $bindings = [], $useReadPdo = true) |
|
191 | { |
|
192 | return $this->run($query, $bindings, function ($query, $bindings) use ($useReadPdo) { |
|
193 | if ($this->pretending()) { |
|
194 | return []; |
|
195 | } |
|
196 | ||
197 | $preparedStatement = $this->session->prepare($query); |
|
198 | ||
199 | return $this->session->execute($preparedStatement, new ExecutionOptions(['arguments' => $bindings])); |
|
200 | }); |
|
201 | } |
|
202 | ||
203 | /** |
|
204 | * Run an bulk insert statement against the database. |
|
@@ 247-258 (lines=12) @@ | ||
244 | * @param array $bindings |
|
245 | * @return bool |
|
246 | */ |
|
247 | public function statement($query, $bindings = []) |
|
248 | { |
|
249 | return $this->run($query, $bindings, function ($query, $bindings) { |
|
250 | if ($this->pretending()) { |
|
251 | return []; |
|
252 | } |
|
253 | ||
254 | $preparedStatement = $this->session->prepare($query); |
|
255 | ||
256 | return $this->session->execute($preparedStatement, new ExecutionOptions(['arguments' => $bindings])); |
|
257 | }); |
|
258 | } |
|
259 | ||
260 | /** |
|
261 | * Because Cassandra is an eventually consistent database, it's not possible to obtain |
|
@@ 269-282 (lines=14) @@ | ||
266 | * @param array $bindings |
|
267 | * @return int |
|
268 | */ |
|
269 | public function affectingStatement($query, $bindings = []) |
|
270 | { |
|
271 | return $this->run($query, $bindings, function ($query, $bindings) { |
|
272 | if ($this->pretending()) { |
|
273 | return 0; |
|
274 | } |
|
275 | ||
276 | $preparedStatement = $this->session->prepare($query); |
|
277 | ||
278 | $this->session->execute($preparedStatement, new ExecutionOptions(['arguments' => $bindings])); |
|
279 | ||
280 | return 1; |
|
281 | }); |
|
282 | } |
|
283 | ||
284 | /** |
|
285 | * @inheritdoc |