-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathQueryBuilder.php
53 lines (47 loc) · 1.62 KB
/
QueryBuilder.php
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
<?php
/*
* Opulence
*
* @link https://www.opulencephp.com
* @copyright Copyright (C) 2021 David Young
* @license https://github.com/opulencephp/Opulence/blob/1.2/LICENSE.md
*/
namespace Opulence\QueryBuilders;
/**
* Programmatically builds up a database query
*/
abstract class QueryBuilder
{
/**
* Starts a new delete query
*
* @param string $tableName The name of the table we're deleting from
* @param string $alias The alias of the table name
* @return DeleteQuery The delete query builder
*/
abstract public function delete(string $tableName, string $alias = '');
/**
* Starts a new insert query
*
* @param string $tableName The name of the table we're inserting into
* @param array $columnNamesToValues The mapping of column names to their respective values
* @return InsertQuery The insert query builder
*/
abstract public function insert(string $tableName, array $columnNamesToValues);
/**
* Starts a new select query
*
* @param mixed ...$expression A variable list of select expressions
* @return SelectQuery The select query builder
*/
abstract public function select(...$expression);
/**
* Starts a new update query
*
* @param string $tableName The name of the table we're updating
* @param string $alias The alias of the table name
* @param array $columnNamesToValues The mapping of column names to their respective values
* @return UpdateQuery The update query builder
*/
abstract public function update(string $tableName, string $alias, array $columnNamesToValues);
}