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 |
2 | /** |
3 | * This file is part of the sshilko/php-sql-mydb package. |
4 | * |
5 | * (c) Sergei Shilko <contact@sshilko.com> |
6 | * |
7 | * MIT License |
8 | * |
9 | * For the full copyright and license information, please view the LICENSE |
10 | * file that was distributed with this source code. |
11 | * @license https://opensource.org/licenses/mit-license.php MIT |
12 | */ |
13 | |
14 | declare(strict_types = 1); |
15 | |
16 | namespace sql\MydbInterface; |
17 | |
18 | /** |
19 | * These statements do not implicitly commit the current transaction. |
20 | * |
21 | * Data Manipulation Language (DML) statements are used for managing data within |
22 | * schema objects DML deals with data manipulation, and therefore includes most common |
23 | * SQL statements such as SELECT, INSERT, etc. DML allows adding / modifying / deleting data itself. |
24 | * |
25 | * @see https://dev.mysql.com/doc/refman/8.0/en/sql-data-manipulation-statements.html |
26 | * @author Sergei Shilko <contact@sshilko.com> |
27 | * @license https://opensource.org/licenses/mit-license.php MIT |
28 | * @category interfaces |
29 | * @see https://github.com/sshilko/php-sql-mydb |
30 | */ |
31 | interface DataManipulationStatementsInterface |
32 | { |
33 | /** |
34 | * @param array<string, (float|int|string|\sql\MydbExpressionInterface|null)> $update |
35 | */ |
36 | public function updateWhere(array $update, array $whereFields, string $table, array $whereNotFields = []): ?int; |
37 | |
38 | public function deleteWhere(array $whereFields, string $table, array $whereNotFields = []): ?int; |
39 | |
40 | public function updateWhereMany(array $columnSetWhere, array $where, string $table): void; |
41 | |
42 | /** |
43 | * @psalm-param array<array-key, array<(float|int|string|\sql\MydbExpressionInterface|null)>> $data |
44 | * @param array<string> $cols |
45 | */ |
46 | public function insertMany( |
47 | array $data, |
48 | array $cols, |
49 | string $table, |
50 | bool $ignore = false, |
51 | string $onDuplicateSql = '', |
52 | ): void; |
53 | |
54 | /** |
55 | * @param array<string, (float|int|\sql\MydbExpressionInterface|string|null)> $data |
56 | */ |
57 | public function insertOne(array $data, string $table): ?string; |
58 | |
59 | /** |
60 | * @param array<string, (float|int|\sql\MydbExpressionInterface|string|null)> $data |
61 | */ |
62 | public function replaceOne(array $data, string $table): ?string; |
63 | |
64 | public function select(string $query): ?array; |
65 | |
66 | public function insert(string $query): ?string; |
67 | |
68 | public function update(string $query): ?int; |
69 | |
70 | public function delete(string $query): ?int; |
71 | |
72 | public function replace(string $query): ?string; |
73 | } |