Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
1 | <?php declare(strict_types=1); |
2 | /** |
3 | * Query |
4 | * |
5 | * SQL Query Builder / Database Abstraction Layer |
6 | * |
7 | * PHP version 8.1 |
8 | * |
9 | * @package Query |
10 | * @author Timothy J. Warren <tim@timshome.page> |
11 | * @copyright 2012 - 2023 Timothy J. Warren |
12 | * @license http://www.opensource.org/licenses/mit-license.html MIT License |
13 | * @link https://git.timshomepage.net/aviat/Query |
14 | * @version 4.0.0 |
15 | */ |
16 | |
17 | namespace Query\Drivers; |
18 | |
19 | /** |
20 | * Interface for database-specific syntax subclasses |
21 | */ |
22 | interface SQLInterface |
23 | { |
24 | /** |
25 | * Get database specific sql for limit clause |
26 | */ |
27 | public function limit(string $sql, int $limit, ?int $offset=NULL): string; |
28 | |
29 | /** |
30 | * Modify the query to get the query plan |
31 | */ |
32 | public function explain(string $sql): string; |
33 | |
34 | /** |
35 | * Get the sql for random ordering |
36 | */ |
37 | public function random(): string; |
38 | |
39 | /** |
40 | * Returns sql to list other databases |
41 | */ |
42 | public function dbList(): string; |
43 | |
44 | /** |
45 | * Returns sql to list tables |
46 | */ |
47 | public function tableList(): string; |
48 | |
49 | /** |
50 | * Returns sql to list system tables |
51 | */ |
52 | public function systemTableList(): string|array; |
53 | |
54 | /** |
55 | * Returns sql to list views |
56 | */ |
57 | public function viewList(): string; |
58 | |
59 | /** |
60 | * Returns sql to list triggers |
61 | */ |
62 | public function triggerList(): ?string; |
63 | |
64 | /** |
65 | * Return sql to list functions |
66 | */ |
67 | public function functionList(): ?string; |
68 | |
69 | /** |
70 | * Return sql to list stored procedures |
71 | */ |
72 | public function procedureList(): ?string; |
73 | |
74 | /** |
75 | * Return sql to list sequences |
76 | */ |
77 | public function sequenceList(): ?string; |
78 | |
79 | /** |
80 | * Return sql to list database field types |
81 | */ |
82 | public function typeList(): string|array; |
83 | |
84 | /** |
85 | * Get information about the columns in the |
86 | * specified table |
87 | */ |
88 | public function columnList(string $table): string; |
89 | |
90 | /** |
91 | * Get the list of foreign keys for the current |
92 | * table |
93 | */ |
94 | public function fkList(string $table): string; |
95 | |
96 | /** |
97 | * Get the list of indexes for the current table |
98 | */ |
99 | public function indexList(string $table): string; |
100 | } |