Query/src/Drivers/SQLInterface.php

138 lines
2.3 KiB
PHP
Raw Normal View History

2016-10-12 22:12:25 -04:00
<?php declare(strict_types=1);
2012-04-10 14:06:34 -04:00
/**
* Query
*
2016-09-07 13:17:17 -04:00
* SQL Query Builder / Database Abstraction Layer
2012-04-10 14:06:34 -04:00
*
2018-01-19 13:43:19 -05:00
* PHP version 7.1
2016-09-07 13:17:17 -04:00
*
* @package Query
* @author Timothy J. Warren <tim@timshomepage.net>
2018-01-19 13:43:19 -05:00
* @copyright 2012 - 2018 Timothy J. Warren
2016-09-07 13:17:17 -04:00
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link https://git.timshomepage.net/aviat4ion/Query
2012-04-10 14:06:34 -04:00
*/
2016-09-07 17:39:19 -04:00
namespace Query\Drivers;
2014-04-02 17:08:50 -04:00
2012-04-10 14:06:34 -04:00
/**
2012-12-18 16:19:52 -05:00
* parent for database manipulation subclasses
2012-04-20 13:17:39 -04:00
*
* @package Query
2014-03-31 16:01:58 -04:00
* @subpackage Drivers
2012-04-10 14:06:34 -04:00
*/
2015-11-10 11:10:15 -05:00
interface SQLInterface {
2012-04-10 14:06:34 -04:00
/**
* Get database specific sql for limit clause
*
* @param string $sql
* @param int $limit
2014-04-22 14:02:54 -04:00
* @param int|bool $offset
2012-04-10 14:06:34 -04:00
* @return string
*/
2012-12-18 16:19:52 -05:00
public function limit($sql, $limit, $offset=FALSE);
2014-02-04 20:59:30 -05:00
/**
* Modify the query to get the query plan
*
* @param string $sql
* @return string
*/
public function explain($sql);
2012-04-10 14:06:34 -04:00
/**
* Get the sql for random ordering
*
* @return string
*/
2012-12-18 16:19:52 -05:00
public function random();
2012-04-10 14:06:34 -04:00
/**
* Returns sql to list other databases
*
* @return string
*/
2016-10-13 21:55:23 -04:00
public function dbList();
2012-04-10 14:06:34 -04:00
/**
* Returns sql to list tables
*
* @return string
*/
2016-10-13 21:55:23 -04:00
public function tableList();
2012-04-10 14:06:34 -04:00
/**
* Returns sql to list system tables
*
* @return string
*/
2016-10-13 21:55:23 -04:00
public function systemTableList();
2012-04-10 14:06:34 -04:00
/**
* Returns sql to list views
*
* @return string
*/
2016-10-13 21:55:23 -04:00
public function viewList();
2012-04-10 14:06:34 -04:00
/**
* Returns sql to list triggers
*
* @return string
*/
2016-10-13 21:55:23 -04:00
public function triggerList();
2012-04-10 14:06:34 -04:00
/**
* Return sql to list functions
*
* @return NULL
2012-04-10 14:06:34 -04:00
*/
2016-10-13 21:55:23 -04:00
public function functionList();
2012-04-10 14:06:34 -04:00
/**
* Return sql to list stored procedures
*
* @return string
*/
2016-10-13 21:55:23 -04:00
public function procedureList();
2012-04-10 14:06:34 -04:00
/**
* Return sql to list sequences
*
* @return string
*/
2016-10-13 21:55:23 -04:00
public function sequenceList();
/**
* Return sql to list database field types
*
2014-04-02 11:02:18 -04:00
* @return string|array
*/
2016-10-13 21:55:23 -04:00
public function typeList();
/**
* Get information about the columns in the
* specified table
*
* @param string $table
* @return string
*/
2016-10-13 21:55:23 -04:00
public function columnList($table);
/**
* Get the list of foreign keys for the current
* table
*
* @param string $table
* @return array
*/
2016-10-13 21:55:23 -04:00
public function fkList($table);
/**
* Get the list of indexes for the current table
*
* @param string $table
* @return array
*/
2016-10-13 21:55:23 -04:00
public function indexList($table);
}