-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathConnectionInterface.php
More file actions
91 lines (58 loc) · 2.31 KB
/
Copy pathConnectionInterface.php
File metadata and controls
91 lines (58 loc) · 2.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<?php
namespace Mix\Database;
/**
* Interface ConnectionInterface
* @package Mix\Database
*/
interface ConnectionInterface
{
public function debug(\Closure $func): ConnectionInterface;
public function raw(string $sql, ...$values): ConnectionInterface;
public function exec(string $sql, ...$values): ConnectionInterface;
public function table(string $table): ConnectionInterface;
public function select(string ...$fields): ConnectionInterface;
public function join(string $table, string $on, ...$values): ConnectionInterface;
public function leftJoin(string $table, string $on, ...$values): ConnectionInterface;
public function rightJoin(string $table, string $on, ...$values): ConnectionInterface;
public function fullJoin(string $table, string $on, ...$values): ConnectionInterface;
public function where(string $expr, ...$values): ConnectionInterface;
public function or(string $expr, ...$values): ConnectionInterface;
public function order(string $field, string $order): ConnectionInterface;
public function group(string ...$fields): ConnectionInterface;
public function having(string $expr, ...$values): ConnectionInterface;
public function offset(int $length): ConnectionInterface;
public function limit(int $length): ConnectionInterface;
public function lockForUpdate(): ConnectionInterface;
public function sharedLock(): ConnectionInterface;
/**
* 返回多行
* @return array
*/
public function get(): array;
/**
* 返回一行
* @return array|object|false
*/
public function first();
/**
* 返回单个值
* @param string $field
* @return mixed
* @throws \PDOException
*/
public function value(string $field);
public function updates(array $data): ConnectionInterface;
public function update(string $field, $value): ConnectionInterface;
public function delete(): ConnectionInterface;
/**
* 自动事务
* @param \Closure $closure
* @throws \Throwable
*/
public function transaction(\Closure $closure);
public function beginTransaction(): Transaction;
public function statement(): \PDOStatement;
public function lastInsertId(): string;
public function rowCount(): int;
public function queryLog(): array;
}