class ContextMariaDb100100 extends Context

Context for MariaDB 10.1.

Constants

KEYWORD_MAX_LENGTH

The maximum length of a keyword.

LABEL_MAX_LENGTH

The maximum length of a label.

OPERATOR_MAX_LENGTH

The maximum length of an operator.

SQL_MODE_COMPAT_MYSQL

SQL_MODE_ALLOW_INVALID_DATES

SQL_MODE_ANSI_QUOTES

SQL_MODE_ERROR_FOR_DIVISION_BY_ZERO

SQL_MODE_HIGH_NOT_PRECEDENCE

SQL_MODE_IGNORE_SPACE

SQL_MODE_NO_AUTO_CREATE_USER

SQL_MODE_NO_AUTO_VALUE_ON_ZERO

SQL_MODE_NO_BACKSLASH_ESCAPES

SQL_MODE_NO_DIR_IN_CREATE

SQL_MODE_NO_ENGINE_SUBSTITUTION

SQL_MODE_NO_FIELD_OPTIONS

SQL_MODE_NO_KEY_OPTIONS

SQL_MODE_NO_TABLE_OPTIONS

SQL_MODE_NO_UNSIGNED_SUBTRACTION

SQL_MODE_NO_ZERO_DATE

SQL_MODE_NO_ZERO_IN_DATE

SQL_MODE_ONLY_FULL_GROUP_BY

SQL_MODE_PIPES_AS_CONCAT

SQL_MODE_REAL_AS_FLOAT

SQL_MODE_STRICT_ALL_TABLES

SQL_MODE_STRICT_TRANS_TABLES

SQL_MODE_NO_ENCLOSING_QUOTES

SQL_MODE_ANSI

SQL_MODE_DB2

SQL_MODE_MAXDB

SQL_MODE_MSSQL

SQL_MODE_ORACLE

SQL_MODE_POSTGRESQL

SQL_MODE_TRADITIONAL

Properties

static string $defaultContext The name of the default content. from Context
static string $loadedContext The name of the loaded context. from Context
static string $contextPrefix The prefix concatenated to the context name when an incomplete class name is specified. from Context
static array $KEYWORDS List of keywords.
static array $OPERATORS List of operators and their flags. from Context
static int $MODE The mode of the MySQL server that will be used in lexing, parsing and building the statements. from Context

Methods

static int
isKeyword(string $str, bool $isReserved = false)

Checks if the given string is a keyword.

from Context
static int
isOperator(string $str)

Checks if the given string is an operator.

from Context
static bool
isWhitespace(string $str)

Checks if the given character is a whitespace.

from Context
static int
isComment(string $str, mixed $end = false)

Checks if the given string is the beginning of a whitespace.

from Context
static bool
isBool(string $str)

Checks if the given string is a boolean value.

from Context
static bool
isNumber(string $str)

Checks if the given character can be a part of a number.

from Context
static int
isSymbol(string $str)

Checks if the given character is the beginning of a symbol. A symbol can be either a variable or a field name.

from Context
static int
isString(string $str)

Checks if the given character is the beginning of a string.

from Context
static bool
isSeparator(string $str)

Checks if the given character can be a separator for two lexeme.

from Context
static 
load(string $context = '')

Loads the specified context.

from Context
static string
loadClosest(string $context = '')

Loads the context with the closest version to the one specified.

from Context
static 
setMode(string $mode = '')

Sets the SQL mode.

from Context
static string
escape(array|string $str, string $quote = '`')

Escapes the symbol by adding surrounding backticks.

from Context

Details

in Context at line 253
static int isKeyword(string $str, bool $isReserved = false)

Checks if the given string is a keyword.

Parameters

string $str string to be checked
bool $isReserved checks if the keyword is reserved

Return Value

int

in Context at line 278
static int isOperator(string $str)

Checks if the given string is an operator.

Parameters

string $str string to be checked

Return Value

int the appropriate flag for the operator

in Context at line 297
static bool isWhitespace(string $str)

Checks if the given character is a whitespace.

Parameters

string $str string to be checked

Return Value

bool

in Context at line 313
static int isComment(string $str, mixed $end = false)

Checks if the given string is the beginning of a whitespace.

Parameters

string $str string to be checked
mixed $end

Return Value

int the appropriate flag for the comment type

in Context at line 349
static bool isBool(string $str)

Checks if the given string is a boolean value.

This actually check only for TRUE and FALSE because 1 or 0 are actually numbers and are parsed by specific methods.

Parameters

string $str string to be checked

Return Value

bool

in Context at line 366
static bool isNumber(string $str)

Checks if the given character can be a part of a number.

Parameters

string $str string to be checked

Return Value

bool

in Context at line 383
static int isSymbol(string $str)

Checks if the given character is the beginning of a symbol. A symbol can be either a variable or a field name.

Parameters

string $str string to be checked

Return Value

int the appropriate flag for the symbol type

in Context at line 409
static int isString(string $str)

Checks if the given character is the beginning of a string.

Parameters

string $str string to be checked

Return Value

int the appropriate flag for the string type

in Context at line 433
static bool isSeparator(string $str)

Checks if the given character can be a separator for two lexeme.

Parameters

string $str string to be checked

Return Value

bool

in Context at line 453
static load(string $context = '')

Loads the specified context.

Contexts may be used by accessing the context directly.

Parameters

string $context name of the context or full class name that defines the context

Exceptions

LoaderException if the specified context doesn't exist

in Context at line 485
static string loadClosest(string $context = '')

Loads the context with the closest version to the one specified.

The closest context is found by replacing last digits with zero until one is loaded successfully.

Parameters

string $context name of the context or full class name that defines the context

Return Value

string The loaded context. null if no context was loaded.

See also

in Context at line 520
static setMode(string $mode = '')

Sets the SQL mode.

Parameters

string $mode The list of modes. If empty, the mode is reset.

in Context at line 540
static string escape(array|string $str, string $quote = '`')

Escapes the symbol by adding surrounding backticks.

Parameters

array|string $str the string to be escaped
string $quote quote to be used when escaping

Return Value

string