classSqlMode
final class SqlMode
Public API: explicitly declared with
@visibility public.The parts of MySQL's sql_mode that change how text is tokenized.
$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 = falsepublic bool $pipesAsConcat = falsepublic bool $highNotPrecedence = falsepublic bool $noBackslashEscapes = falsepublic bool $ignoreSpace = falseMethods§
public function __construct(
public bool $ansiQuotes = false,
public bool $pipesAsConcat = false,
public bool $highNotPrecedence = false,
public bool $noBackslashEscapes = false,
public bool $ignoreSpace = false,
)Parameters
$ansiQuotes | bool | Whether double quotes delimit identifiers instead of strings |
$pipesAsConcat | bool | Whether `||` is string concatenation instead of `OR` |
$highNotPrecedence | bool | Whether `NOT` binds as tightly as `!` |
$noBackslashEscapes | bool | Whether a backslash in a string is an ordinary character |
$ignoreSpace | bool | Whether a function name may be followed by spaces before its parenthesis |
public static function default(): selfAnswers the mode a fresh MySQL server runs with.
Returns
self The default modeTest cases 1
SqlModeTest::testDefaultcalls
Calls 1
- new
selfline 42
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
RendererTest::testRenderHonorsMysqlLexicalModescallsFormatterTest::testFormatPreservesMysqlSqlModecallsKeywordTableTest::testLoadcallsKeywordTableTest::testLookupcallsKeywordTableTest::testLookupFollowsTheModecallsMySqlLexerTest::testNextcallsNumberScannerTest::testFractioncallsNumberScannerTest::testScancallsNumberScannerTest::testScanNotesAQualifiedIdentifierThatStartsWithADigitcallsOperatorScannerTest::testMultiCharactercallsOperatorScannerTest::testScancallsOperatorScannerTest::testScanRejectsAForeignCharactercallsOperatorScannerTest::testScanRejectsAParameterMarkerGluedToANamecallsOperatorScannerTest::testSeparatorcallsQuotedScannerTest::testQuotedIdentifiercallsQuotedScannerTest::testQuotedIdentifierRejectsAnUnterminatedIdentifiercallsQuotedScannerTest::testScanReadsPrefixedLiteralscallsQuotedScannerTest::testScanReadsStringsAndIdentifierscallsQuotedScannerTest::testScanRejectsAnOddHexadecimalLiteralcallsQuotedScannerTest::testStringcallsQuotedScannerTest::testStringRejectsAnUnterminatedStringcallsScanTest::testLexemecallsTriviaScannerTest::testBlockCommentcallsTriviaScannerTest::testBlockCommentRejectsAnUnterminatedCommentcallsTriviaScannerTest::testSkipDropsAVersionCommentForANewerReleasecallsTriviaScannerTest::testSkipPassesWhitespaceAndCommentscallsTriviaScannerTest::testSkipReadsAVersionCommentBodyAsSqlcallsVariableScannerTest::testAtcallsVariableScannerTest::testHostnamecallsVariableScannerTest::testIdentifierOrKeywordcallsVariableScannerTest::testIdentifierOrKeywordRejectsAMissingNamecallsVariableScannerTest::testSystemVariablecallsWordScannerTest::testDollarQuotedcallsWordScannerTest::testDollarQuotedRejectsAnUnterminatedStringcallsWordScannerTest::testIdentifiercallsWordScannerTest::testIdentifierLexemecallsWordScannerTest::testScancallsWordScannerTest::testWordKeepsAKeywordBeforeADotAsAnIdentifiercallsWordScannerTest::testWordLooksUpFunctionsAcrossSpacesUnderIgnoreSpacecallsMySqlParserTest::testTokenizeHonoursTheModecalls
Relations§
Instantiated in 2
Type declarations 4
- type SqlParser\MySql\Lexer\KeywordTable packages/sql-parser/src/MySql/Lexer/KeywordTable.php:61
- type SqlParser\MySql\Lexer\MySqlLexer packages/sql-parser/src/MySql/Lexer/MySqlLexer.php:38
- type SqlParser\MySql\Lexer\Scan packages/sql-parser/src/MySql/Lexer/Scan.php:38
- type SqlParser\MySql\MySqlParser packages/sql-parser/src/MySql/MySqlParser.php:62