final class SqlMode
Public API: explicitly declared with @visibility public.

The parts of MySQL's sql_mode that change how text is tokenized.

Reading double quotes as identifiersdoctest
$mode = new \SqlParser\MySql\SqlMode(ansiQuotes: true);
    $parser = new \SqlParser\MySql\MySqlParser(mode: $mode);
    $parser->tokenize('SELECT "x"')[1]->name // => 'IDENT_QUOTED'

Properties§

public bool $ansiQuotes = false
public bool $pipesAsConcat = false
public bool $highNotPrecedence = false
public bool $noBackslashEscapes = false
public bool $ignoreSpace = false

Methods§

public function __construct(
    public bool $ansiQuotes = false,
    public bool $pipesAsConcat = false,
    public bool $highNotPrecedence = false,
    public bool $noBackslashEscapes = false,
    public bool $ignoreSpace = false,
)

Parameters

$ansiQuotesboolWhether double quotes delimit identifiers instead of strings
$pipesAsConcatboolWhether `||` is string concatenation instead of `OR`
$highNotPrecedenceboolWhether `NOT` binds as tightly as `!`
$noBackslashEscapesboolWhether a backslash in a string is an ordinary character
$ignoreSpaceboolWhether a function name may be followed by spaces before its parenthesis
public static function default(): self

Answers the mode a fresh MySQL server runs with.

Returns

self The default mode
Test cases 1
Calls 1

Test cases 42§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 2
Other tests reaching this symbol 40

Relations§

Instantiated in 2
Type declarations 4