# phpDox - Source of SQLInterface.php

# Source of file SQLInterface.php

Size: 2,492 Bytes - Last Modified: 2020-04-17T14:56:27-04:00

## src/Drivers/SQLInterface.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 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 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136

    <?php declare(strict_types=1);

    /**

     * Query

     *

     * SQL Query Builder / Database Abstraction Layer

     *

     * PHP version 7.4

     *

     * @package     Query

     * @author      Timothy J. Warren <tim@timshomepage.net>

     * @copyright   2012 - 2020 Timothy J. Warren

     * @license     http://www.opensource.org/licenses/mit-license.html  MIT License

     * @link        https://git.timshomepage.net/aviat/Query

     * @version     3.0.0

     */

    namespace Query\Drivers;

    /**

     * Interface for database-specific syntax subclasses

     */

    interface SQLInterface {

    	/**

    	 * Get database specific sql for limit clause

    	 *

    	 * @param string $sql

    	 * @param int $limit

    	 * @param int|null $offset

    	 * @return string

    	 */

    	public function limit(string $sql, int $limit, ?int $offset=NULL): string;

    	/**

    	 * Modify the query to get the query plan

    	 *

    	 * @param string $sql

    	 * @return string

    	 */

    	public function explain(string $sql): string;

    	/**

    	 * Get the sql for random ordering

    	 *

    	 * @return string

    	 */

    	public function random(): string;

    	/**

    	 * Returns sql to list other databases

    	 *

    	 * @return string

    	 */

    	public function dbList(): string;

    	/**

    	 * Returns sql to list tables

    	 *

    	 * @return string

    	 */

    	public function tableList(): string;

    	/**

    	 * Returns sql to list system tables

    	 *

    	 * @return string|array

    	 */

    	public function systemTableList();

    	/**

    	 * Returns sql to list views

    	 *

    	 * @return string

    	 */

    	public function viewList(): string;

    	/**

    	 * Returns sql to list triggers

    	 *

    	 * @return string

    	 */

    	public function triggerList(): ?string;

    	/**

    	 * Return sql to list functions

    	 *

    	 * @return string

    	 */

    	public function functionList(): ?string;

    	/**

    	 * Return sql to list stored procedures

    	 *

    	 * @return string

    	 */

    	public function procedureList(): ?string;

    	/**

    	 * Return sql to list sequences

    	 *

    	 * @return string

    	 */

    	public function sequenceList(): ?string;

    	/**

    	 * Return sql to list database field types

    	 *

    	 * @return string|array

    	 */

    	public function typeList();

    	/**

    	 * Get information about the columns in the

    	 * specified table

    	 *

    	 * @param string $table

    	 * @return string

    	 */

    	public function columnList(string $table): string;

    	/**

    	 * Get the list of foreign keys for the current

    	 * table

    	 *

    	 * @param string $table

    	 * @return string

    	 */

    	public function fkList(string $table): string;

    	/**

    	 * Get the list of indexes for the current table

    	 *

    	 * @param string $table

    	 * @return string

    	 */

    	public function indexList(string $table): string;

    }