@@ 188-199 (lines=12) @@ | ||
185 | * @param bool $useReadPdo |
|
186 | * @return array |
|
187 | */ |
|
188 | public function select($query, $bindings = [], $useReadPdo = true) |
|
189 | { |
|
190 | return $this->run($query, $bindings, function ($query, $bindings) use ($useReadPdo) { |
|
191 | if ($this->pretending()) { |
|
192 | return []; |
|
193 | } |
|
194 | ||
195 | $statement = $this->session->prepare($query); |
|
196 | ||
197 | return $this->session->execute($statement, new \Cassandra\ExecutionOptions(['arguments' => $bindings])); |
|
198 | }); |
|
199 | } |
|
200 | ||
201 | /** |
|
202 | * Execute an SQL statement and return the boolean result. |
|
@@ 208-219 (lines=12) @@ | ||
205 | * @param array $bindings |
|
206 | * @return bool |
|
207 | */ |
|
208 | public function statement($query, $bindings = []) |
|
209 | { |
|
210 | return $this->run($query, $bindings, function ($query, $bindings) { |
|
211 | if ($this->pretending()) { |
|
212 | return []; |
|
213 | } |
|
214 | ||
215 | $statement = $this->session->prepare($query); |
|
216 | ||
217 | return $this->session->execute($statement, new \Cassandra\ExecutionOptions(['arguments' => $bindings])); |
|
218 | }); |
|
219 | } |
|
220 | ||
221 | /** |
|
222 | * Because Cassandra is an eventually consistent database, it's not possible to obtain |
|
@@ 230-243 (lines=14) @@ | ||
227 | * @param array $bindings |
|
228 | * @return int |
|
229 | */ |
|
230 | public function affectingStatement($query, $bindings = []) |
|
231 | { |
|
232 | return $this->run($query, $bindings, function ($query, $bindings) { |
|
233 | if ($this->pretending()) { |
|
234 | return 0; |
|
235 | } |
|
236 | ||
237 | $statement = $this->session->prepare($query); |
|
238 | ||
239 | $this->session->execute($statement, new \Cassandra\ExecutionOptions(['arguments' => $bindings])); |
|
240 | ||
241 | return 1; |
|
242 | }); |
|
243 | } |
|
244 | ||
245 | /** |
|
246 | * @inheritdoc |