SqlHelper abstract class is used to handle database. Specific classes used to generate SQL queries and inheriting this class help generate individual queries without employing syntax of specific database.

Methods included into this class result in a database string.

Queries to the following namespace:

Returns instance of a descendant from Entity that matches database type.
Method Description Available from version
construct Method - constructor
addSecondsToDateTime Returns SQL function for adding seconds to the specified time interval. 14.0.0
castToChar Returns CAST expression for converted field or string expression. 16.0.10
convertFromDb Returns parameter value converted to required type. 14.5.2
convertToDb Converts value to the string corresponding to the column type used in SQL query. 14.5.2
formatDate Returns database statement for conversion 14.0.0
forSql Escapes special characters in a string for use in a SQL statement.
getAliasLength Returns maximum length of an alias in a sel ect statement. 14.0.0
getAscendingOrder Returns ascending order specifier. 14.5.0
getCharToDateFunction Returns function for converting string value into datetime. 14.0.18
getColumnTypeByField Returns a column type according to ScalarField object. 14.5.2
getConcatFunction Returns function for concatenating database fields or expressions.
getConverter Returns callback to be called for a field value on fetch. 15.0.1
getCurrentDateFunction Returns SQL function for getting current date only.
getCurrentDateTimeFunction Returns SQL function for getting current time.
getDatetimeToDateFunction Returns SQL function passing datetime database value.
getDateToCharFunction Returns SQL function for converting database fields and expressions into string. 14.0.18
getDescendingOrder Returns descending order. 14.5.0
getFieldByColumnType Returns descendant exception fr om Entity\ScalarField that matches the database type. 14.5.2
getIsNullFunction Returns SQL function for checking database fields and statements against NULL value.
getLeftQuote Returns an identificator escaping left character. 14.0.0
getLengthFunction Returns SQL function for getting length of database field or expression.
getQueryDelimiter Returns database specific query delimiter for batch processing..
getRightQuote Returns an identificator escaping right character. 14.0.0
getSubstrFunction Returns SQL function for getting part of string.
getTopSql Transforms SQL query according to specified parameter values. 14.0.0
prepareAssignment Builds a string for assigning SQL statement to the specified column. 14.0.0
prepareInsert Builds string for SQL INSERT command for the specified table.
prepareMerge Builds string for SQL MERGE command for the specified table. 15.5.0
prepareUpdate Builds string for SQL UPDATE command for the specified table.
quote Returns quoted identifier. 14.0.0
softCastTextToChar Return expression for text field used when grouping or sorting. 16.5.7

© «Bitrix24», 2001-2024