* @package Mammut\DB\Dialect */ interface iDialect { const SYMB_QUOTE_IDENT = 'quote_ident'; const SYMB_QUOTE_VALUE = 'quote_ident'; /** * Identifier separator */ const SYMB_IDENT_SEP = 'ident_sep'; public function getName(); /** * * @return true if OFFSET (skipping of the first N rows) is supported by the database */ public function isOffsetSupported(); /** * Checks if the RDBS uses global constraint names. If so, * the database abstraction layer uses the table name as a constraint name prefix. * * @return true if constraints have global names */ public function isConstraintNameGlobal(); /** * Fetches a DDL variant of the dialect * * @return Ddl\iDdlDialect */ public function getDdl(); /** * Quotes a identifier * * @param string|array $identifier */ public function quoteIdent($identifier); public function quoteIdentInFragment($identifier, array $safeWords = array()); /** * Quotes a value * * @param mixed $value * @return string */ public function quoteValue($value); /** * * @return string */ public function escapeString($string); /** * * @param string $type one of the SYMB_* constants * @return string */ public function getSymbol($type); /** * Returns an "FROM xxx" if the SQL requires it for table free SELECTs (env-settings etc.) */ public function getDummyTableSQL(); /** * Build a INSERT SQL query * * @param array $param * @return string */ public function getInsertSQL(array $param); /** * Build a SELECT SQL query * * @param array $param * @return string */ public function getSelectSQL(array $param); /** * Build a UPDATE SQL query * * @param array $param * @return string */ public function getUpdateSQL(array $param); /** * Build a DELETE SQL query * * @param array $param * @return string */ public function getDeleteSQL(array $param); /** * Build SQL to purges all rows from the table * * @param mixed $table * @return string */ public function getTruncateSQL($table); /** * Build SQL for the matching expression set (WHERE, HAVING) * * @param mixed $param * @return string */ public function getExpressionSQL($param, $hint = NULL); /** * Build SQL for the matching function set (COUNT, MAX, MIN...) * * @param SQLFunction $function * @return string */ public function getFunctionSQL(SQLFunction $function); /** * Converts a generic Types::TYPE_* value to the native type of this dialect * * @param string $type * @return string */ public function getNativeType($type); /** * Converts a native type value of this dialect to the generic Types::TYPE_* * * @param string $type * @return string */ public function getGenericType($type); }