final class TemporalRule
Restricted visibility: declared "@visibility SqlSemantics\Platform\MySql". Code outside that scope must not name this declaration.

Lowers the date and time functions with a special syntax: the clock functions, interval arithmetic, EXTRACT, GET_FORMAT, TIMESTAMPADD and TIMESTAMPDIFF.

Rule: MYSQL-CALL-TEMPORAL-001. Scope: now, func_datetime_precision, date_time_type and the alternatives of function_call_nonkeyword for CURDATE, CURTIME, NOW, SYSDATE, UTC_DATE, UTC_TIME, UTC_TIMESTAMP, DATE_ADD, DATE_SUB, ADDDATE and SUBDATE with INTERVAL, EXTRACT, GET_FORMAT, TIMESTAMPADD and TIMESTAMPDIFF. Empty parentheses after a clock function are optional and change nothing; whether they are written is kept (OptionalWords), since it is part of the text MySQL names an unaliased select list expression after; ADDDATE and SUBDATE with INTERVAL are DATE_ADD and DATE_SUB (CallNoise). Constructs: ClockCall, DateArithmetic, Extract, GetFormat, TimestampCall. Terminates: every child is a strict subtree. Source: https://dev.mysql.com/doc/refman/8.4/en/date-and-time-functions.html. Status: Implemented.

Methods§

public function __construct(private Lowering $lowering)

Parameters

$loweringLoweringThe lowering this rule belongs to
public function claims(string $signature): bool

Tells whether a production is one of this rule.

Parameters

$signaturestring

Returns

bool
Test cases 1
Called from 1
Calls 3
public function precision(Node $precision): ?Numeral
public function format(Node $kind): TemporalFormat

Private surface 4§

Implementation details, listed for orientation only.

private const CLOCKS = ['function_call_nonkeyword: CURDATE optional_braces' => [\SqlSemantics\Platform…
private const ARITHMETIC = ['function_call_nonkeyword: ADDDATE_SYM ( expr , INTERVAL_SYM expr interval )' …
private const FORMATS = ['date_time_type: DATE_SYM' => \SqlSemantics\Platform\MySql\Statement\Call\Temp…
private Lowering $lowering

Test cases 9§

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

Dedicated tests 9

Relations§

Instantiated in 2
Method calls 3