classDollarQuotedText
final class DollarQuotedText
implements Node
uses Snapshot
Public API: explicitly declared with
@visibility public.A dollar-quoted string: $tag$ text $tag$ (MySQL 8.1 and later).
The text between the delimiters is taken as it is, without escapes; the server treats it as the opaque code of an external language. The tag is part of the spelling the text needs: the text cannot hold its own closing delimiter. Source: https://dev.mysql.com/doc/refman/9.1/en/create-procedure.html.
$quoted = new \SqlSemantics\Platform\MySql\Statement\Routine\DollarQuotedText('return 1', 'js');
[$quoted->tag, $quoted->text] // => ['js', 'return 1']Properties§
public string $textpublic string $tag = ''Methods§
public function __construct(public string $text, public string $tag = '')Parameters
$text | string | The text between the delimiters |
$tag | string | The tag between the dollar signs of each delimiter; may be empty |
Calls 3
- static-call Check::input() line 36
- function-call
preg_matchline 36 - function-call
str_containsline 37
public function render(Output $out): voidWrites the delimiters around the text.
Parameters
$out | Output |
Test cases 2
Calls 1
- method-call Output::spelled() line 45
Test cases 10§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 7
DollarQuotedTextTest::testAnUntaggedTextHoldingTwoDollarSignsIsRejectedcallsDollarQuotedTextTest::testATagWithADollarSignIsRejectedcallsDollarQuotedTextTest::testATagWithASpaceIsRejectedcallsDollarQuotedTextTest::testATextHoldingItsClosingDelimiterIsRejectedcallsDollarQuotedTextTest::testRenderKeepsTheTextBetweenTheDelimiterscallsDollarQuotedTextTest::testRenderWritesAConstructedTextcallsDollarQuotedTextTest::testRenderWritesAnEmptyTagcalls