1 |
cb15593b
|
Cajova-Houba
|
<?php
|
2 |
|
|
|
3 |
|
|
namespace Illuminate\Database;
|
4 |
|
|
|
5 |
|
|
use Closure;
|
6 |
|
|
|
7 |
|
|
interface ConnectionInterface
|
8 |
|
|
{
|
9 |
|
|
/**
|
10 |
|
|
* Begin a fluent query against a database table.
|
11 |
|
|
*
|
12 |
|
|
* @param string $table
|
13 |
|
|
* @return \Illuminate\Database\Query\Builder
|
14 |
|
|
*/
|
15 |
|
|
public function table($table);
|
16 |
|
|
|
17 |
|
|
/**
|
18 |
|
|
* Get a new raw query expression.
|
19 |
|
|
*
|
20 |
|
|
* @param mixed $value
|
21 |
|
|
* @return \Illuminate\Database\Query\Expression
|
22 |
|
|
*/
|
23 |
|
|
public function raw($value);
|
24 |
|
|
|
25 |
|
|
/**
|
26 |
|
|
* Run a select statement and return a single result.
|
27 |
|
|
*
|
28 |
|
|
* @param string $query
|
29 |
|
|
* @param array $bindings
|
30 |
|
|
* @return mixed
|
31 |
|
|
*/
|
32 |
|
|
public function selectOne($query, $bindings = []);
|
33 |
|
|
|
34 |
|
|
/**
|
35 |
|
|
* Run a select statement against the database.
|
36 |
|
|
*
|
37 |
|
|
* @param string $query
|
38 |
|
|
* @param array $bindings
|
39 |
|
|
* @return array
|
40 |
|
|
*/
|
41 |
|
|
public function select($query, $bindings = []);
|
42 |
|
|
|
43 |
|
|
/**
|
44 |
|
|
* Run an insert statement against the database.
|
45 |
|
|
*
|
46 |
|
|
* @param string $query
|
47 |
|
|
* @param array $bindings
|
48 |
|
|
* @return bool
|
49 |
|
|
*/
|
50 |
|
|
public function insert($query, $bindings = []);
|
51 |
|
|
|
52 |
|
|
/**
|
53 |
|
|
* Run an update statement against the database.
|
54 |
|
|
*
|
55 |
|
|
* @param string $query
|
56 |
|
|
* @param array $bindings
|
57 |
|
|
* @return int
|
58 |
|
|
*/
|
59 |
|
|
public function update($query, $bindings = []);
|
60 |
|
|
|
61 |
|
|
/**
|
62 |
|
|
* Run a delete statement against the database.
|
63 |
|
|
*
|
64 |
|
|
* @param string $query
|
65 |
|
|
* @param array $bindings
|
66 |
|
|
* @return int
|
67 |
|
|
*/
|
68 |
|
|
public function delete($query, $bindings = []);
|
69 |
|
|
|
70 |
|
|
/**
|
71 |
|
|
* Execute an SQL statement and return the boolean result.
|
72 |
|
|
*
|
73 |
|
|
* @param string $query
|
74 |
|
|
* @param array $bindings
|
75 |
|
|
* @return bool
|
76 |
|
|
*/
|
77 |
|
|
public function statement($query, $bindings = []);
|
78 |
|
|
|
79 |
|
|
/**
|
80 |
|
|
* Run an SQL statement and get the number of rows affected.
|
81 |
|
|
*
|
82 |
|
|
* @param string $query
|
83 |
|
|
* @param array $bindings
|
84 |
|
|
* @return int
|
85 |
|
|
*/
|
86 |
|
|
public function affectingStatement($query, $bindings = []);
|
87 |
|
|
|
88 |
|
|
/**
|
89 |
|
|
* Run a raw, unprepared query against the PDO connection.
|
90 |
|
|
*
|
91 |
|
|
* @param string $query
|
92 |
|
|
* @return bool
|
93 |
|
|
*/
|
94 |
|
|
public function unprepared($query);
|
95 |
|
|
|
96 |
|
|
/**
|
97 |
|
|
* Prepare the query bindings for execution.
|
98 |
|
|
*
|
99 |
|
|
* @param array $bindings
|
100 |
|
|
* @return array
|
101 |
|
|
*/
|
102 |
|
|
public function prepareBindings(array $bindings);
|
103 |
|
|
|
104 |
|
|
/**
|
105 |
|
|
* Execute a Closure within a transaction.
|
106 |
|
|
*
|
107 |
|
|
* @param \Closure $callback
|
108 |
|
|
* @return mixed
|
109 |
|
|
*
|
110 |
|
|
* @throws \Throwable
|
111 |
|
|
*/
|
112 |
|
|
public function transaction(Closure $callback);
|
113 |
|
|
|
114 |
|
|
/**
|
115 |
|
|
* Start a new database transaction.
|
116 |
|
|
*
|
117 |
|
|
* @return void
|
118 |
|
|
*/
|
119 |
|
|
public function beginTransaction();
|
120 |
|
|
|
121 |
|
|
/**
|
122 |
|
|
* Commit the active database transaction.
|
123 |
|
|
*
|
124 |
|
|
* @return void
|
125 |
|
|
*/
|
126 |
|
|
public function commit();
|
127 |
|
|
|
128 |
|
|
/**
|
129 |
|
|
* Rollback the active database transaction.
|
130 |
|
|
*
|
131 |
|
|
* @return void
|
132 |
|
|
*/
|
133 |
|
|
public function rollBack();
|
134 |
|
|
|
135 |
|
|
/**
|
136 |
|
|
* Get the number of active transactions.
|
137 |
|
|
*
|
138 |
|
|
* @return int
|
139 |
|
|
*/
|
140 |
|
|
public function transactionLevel();
|
141 |
|
|
|
142 |
|
|
/**
|
143 |
|
|
* Execute the given callback in "dry run" mode.
|
144 |
|
|
*
|
145 |
|
|
* @param \Closure $callback
|
146 |
|
|
* @return array
|
147 |
|
|
*/
|
148 |
|
|
public function pretend(Closure $callback);
|
149 |
|
|
}
|