Query/src/Query/SQLInterface.php

141 lines
2.3 KiB
PHP
Raw Normal View History

2012-04-10 14:06:34 -04:00
<?php
/**
* Query
*
* Free Query Builder / Database Abstraction Layer
*
2012-04-20 13:17:39 -04:00
* @author Timothy J. Warren
2015-11-10 20:58:32 -05:00
* @copyright Copyright (c) 2012 - 2015
2012-04-10 14:06:34 -04:00
* @link https://github.com/aviat4ion/Query
2012-04-20 13:17:39 -04:00
* @license http://philsturgeon.co.uk/code/dbad-license
* @package Query
2012-04-10 14:06:34 -04:00
*/
// --------------------------------------------------------------------------
namespace Query;
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
*/
2012-12-18 16:19:52 -05:00
public function db_list();
2012-04-10 14:06:34 -04:00
/**
* Returns sql to list tables
*
* @return string
*/
2012-12-18 16:19:52 -05:00
public function table_list();
2012-04-10 14:06:34 -04:00
/**
* Returns sql to list system tables
*
* @return string
*/
2012-12-18 16:19:52 -05:00
public function system_table_list();
2012-04-10 14:06:34 -04:00
/**
* Returns sql to list views
*
* @return string
*/
2012-12-18 16:19:52 -05:00
public function view_list();
2012-04-10 14:06:34 -04:00
/**
* Returns sql to list triggers
*
* @return string
*/
2012-12-18 16:19:52 -05:00
public function trigger_list();
2012-04-10 14:06:34 -04:00
/**
* Return sql to list functions
*
* @return NULL
2012-04-10 14:06:34 -04:00
*/
2012-12-18 16:19:52 -05:00
public function function_list();
2012-04-10 14:06:34 -04:00
/**
* Return sql to list stored procedures
*
* @return string
*/
2012-12-18 16:19:52 -05:00
public function procedure_list();
2012-04-10 14:06:34 -04:00
/**
* Return sql to list sequences
*
* @return string
*/
2012-12-18 16:19:52 -05:00
public function sequence_list();
/**
* Return sql to list database field types
*
2014-04-02 11:02:18 -04:00
* @return string|array
*/
2012-12-18 16:19:52 -05:00
public function type_list();
/**
* Get information about the columns in the
* specified table
*
* @param string $table
* @return string
*/
2012-12-18 16:19:52 -05:00
public function column_list($table);
/**
* Get the list of foreign keys for the current
* table
*
* @param string $table
* @return array
*/
public function fk_list($table);
/**
* Get the list of indexes for the current table
*
* @param string $table
* @return array
*/
public function index_list($table);
2012-04-10 14:06:34 -04:00
}
// End of sql_interface.php