@@ 180-191 (lines=12) @@ | ||
177 | * @param bool $useReadPdo |
|
178 | * @return array |
|
179 | */ |
|
180 | public function select($query, $bindings = [], $useReadPdo = true) |
|
181 | { |
|
182 | return $this->run($query, $bindings, function ($query, $bindings) use ($useReadPdo) { |
|
183 | if ($this->pretending()) { |
|
184 | return []; |
|
185 | } |
|
186 | ||
187 | $preparedStatement = $this->session->prepare($query); |
|
188 | ||
189 | return $this->session->execute($preparedStatement, new ExecutionOptions(['arguments' => $bindings])); |
|
190 | }); |
|
191 | } |
|
192 | ||
193 | /** |
|
194 | * Run an bulk insert statement against the database. |
|
@@ 237-248 (lines=12) @@ | ||
234 | * @param array $bindings |
|
235 | * @return bool |
|
236 | */ |
|
237 | public function statement($query, $bindings = []) |
|
238 | { |
|
239 | return $this->run($query, $bindings, function ($query, $bindings) { |
|
240 | if ($this->pretending()) { |
|
241 | return []; |
|
242 | } |
|
243 | ||
244 | $preparedStatement = $this->session->prepare($query); |
|
245 | ||
246 | return $this->session->execute($preparedStatement, new ExecutionOptions(['arguments' => $bindings])); |
|
247 | }); |
|
248 | } |
|
249 | ||
250 | /** |
|
251 | * Because Cassandra is an eventually consistent database, it's not possible to obtain |
|
@@ 259-272 (lines=14) @@ | ||
256 | * @param array $bindings |
|
257 | * @return int |
|
258 | */ |
|
259 | public function affectingStatement($query, $bindings = []) |
|
260 | { |
|
261 | return $this->run($query, $bindings, function ($query, $bindings) { |
|
262 | if ($this->pretending()) { |
|
263 | return 0; |
|
264 | } |
|
265 | ||
266 | $preparedStatement = $this->session->prepare($query); |
|
267 | ||
268 | $this->session->execute($preparedStatement, new ExecutionOptions(['arguments' => $bindings])); |
|
269 | ||
270 | return 1; |
|
271 | }); |
|
272 | } |
|
273 | ||
274 | /** |
|
275 | * @inheritdoc |