Source of file SQLInterface.php

Size: 2,344 Bytes - Last Modified: 2015-11-10T11:02:11-05:00

../src/Query/SQLInterface.php

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
Covered by 1 test(s):
  • Query_Parser_Test::testGeneric2
<?php
/**
 * Query
 *
 * Free Query Builder / Database Abstraction Layer
 *
 * @author		Timothy J. Warren
 * @copyright	Copyright (c) 2012 - 2014
 * @link 		https://github.com/aviat4ion/Query
 * @license		http://philsturgeon.co.uk/code/dbad-license
 * @package		Query
 */

// --------------------------------------------------------------------------

namespace Query;

/**
 * parent for database manipulation subclasses
 *
 * @package Query
 * @subpackage Drivers
 */
interface SQLInterface {

	/**
	 * Get database specific sql for limit clause
	 *
	 * @param string $sql
	 * @param int $limit
	 * @param int|bool $offset
	 * @return string
	 */
	public function limit($sql, $limit, $offset=FALSE);

	/**
	 * Modify the query to get the query plan
	 *
	 * @param string $sql
	 * @return string
	 */
	public function explain($sql);

	/**
	 * Get the sql for random ordering
	 *
	 * @return string
	 */
	public function random();

	/**
	 * Returns sql to list other databases
	 *
	 * @return string
	 */
	public function db_list();

	/**
	 * Returns sql to list tables
	 *
	 * @return string
	 */
	public function table_list();

	/**
	 * Returns sql to list system tables
	 *
	 * @return string
	 */
	public function system_table_list();

	/**
	 * Returns sql to list views
	 *
	 * @return string
	 */
	public function view_list();

	/**
	 * Returns sql to list triggers
	 *
	 * @return string
	 */
	public function trigger_list();

	/**
	 * Return sql to list functions
	 *
	 * @return NULL
	 */
	public function function_list();

	/**
	 * Return sql to list stored procedures
	 *
	 * @return string
	 */
	public function procedure_list();

	/**
	 * Return sql to list sequences
	 *
	 * @return string
	 */
	public function sequence_list();

	/**
	 * Return sql to list database field types
	 *
	 * @return string|array
	 */
	public function type_list();

	/**
	 * Get information about the columns in the
	 * specified table
	 *
	 * @param string $table
	 * @return string
	 */
	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);

}
// End of sql_interface.php