enumClock
enum Clock: string
@visibility public.The functions that read the current date or time of the statement or of the system clock.
Each case holds the keyword the function is written with. CURRENT_DATE is the keyword CURDATE, CURRENT_TIME is CURTIME, and CURRENT_TIMESTAMP, LOCALTIME and LOCALTIMESTAMP are NOW to the lexer. NOW and its synonyms read the time the statement started; SYSDATE reads the time it executes. Source: https://dev.mysql.com/doc/refman/8.4/en/date-and-time-functions.html#function_now.
\SqlSemantics\Platform\MySql\Statement\Call\Clock::Now->value // => 'NOW'Cases§
case Now = 'NOW'case CurrentTime = 'CURTIME'case SystemDate = 'SYSDATE'case UtcTime = 'UTC_TIME'case UtcTimestamp = 'UTC_TIMESTAMP'case CurrentDate = 'CURDATE'case UtcDate = 'UTC_DATE'Methods§
public function precise(): boolTells whether the function takes a fractional seconds precision.
Returns
boolCalled from 1
Calls 2
- class-const Clock::CurrentDate() line 37
- class-const Clock::UtcDate() line 37
public function bare(): ?stringAnswers the keyword that writes the function without parentheses, or null when it is only written with them.
NOW, CURTIME, CURDATE and SYSDATE are keywords only before an opening parenthesis (SYM_FN in sql/lex.h); without one the function is written CURRENT_TIMESTAMP, CURRENT_TIME or CURRENT_DATE, and SYSDATE cannot be.
Returns
?string\SqlSemantics\Platform\MySql\Statement\Call\Clock::Now->bare() // => 'CURRENT_TIMESTAMP'Test cases 1
Called from 2
Calls 7
- class-const Clock::Now() line 54
- class-const Clock::CurrentTime() line 55
- class-const Clock::CurrentDate() line 56
- class-const Clock::SystemDate() line 57
- class-const Clock::UtcTime() line 58
- class-const Clock::UtcTimestamp() line 58
- class-const Clock::UtcDate() line 58
public function result(): TypeClassAnswers the class of the type the function returns.
Returns
Called from 1
Calls 10
- class-const Clock::Now() line 68
- class-const Clock::SystemDate() line 68
- class-const Clock::UtcTimestamp() line 68
- class-const TypeClass::DateTime() line 68
- class-const Clock::CurrentTime() line 69
- class-const Clock::UtcTime() line 69
- class-const TypeClass::Time() line 69
- class-const Clock::CurrentDate() line 70
- class-const Clock::UtcDate() line 70
- class-const TypeClass::Date() line 70
Test cases 8§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 3
Other tests reaching this symbol 5
CallRulesTest::testCurrentTimestampLowersNowcallsTemporalRuleTest::testCallLowersTheTemporalSyntaxescallsTemporalRuleTest::testCurrentTimestampLowersNowcallsClockCallTest::testDeriveScalarAnswersATemporalTypeThatIsNeverNullcallsClockCallTest::testRenderWritesEmptyParenthesesWithoutAPrecisioncalls
Relations§
Method calls 4
- method-call SqlSemantics\Platform\MySql\Statement\Call\ClockCall::__construct() packages/sql-semantics-mysql/src/Statement/Call/ClockCall.php:52
- method-call SqlSemantics\Platform\MySql\Statement\Call\ClockCall::__construct() packages/sql-semantics-mysql/src/Statement/Call/ClockCall.php:53
- method-call SqlSemantics\Platform\MySql\Statement\Call\ClockCall::deriveScalar() packages/sql-semantics-mysql/src/Statement/Call/ClockCall.php:61
- method-call SqlSemantics\Platform\MySql\Statement\Call\ClockCall::render() packages/sql-semantics-mysql/src/Statement/Call/ClockCall.php:75
Constant reads 7
- class-const SqlSemantics\Platform\MySql\Lowering\Call\TemporalRule packages/sql-semantics-mysql/src/Lowering/Call/TemporalRule.php:48
- class-const SqlSemantics\Platform\MySql\Lowering\Call\TemporalRule packages/sql-semantics-mysql/src/Lowering/Call/TemporalRule.php:49
- class-const SqlSemantics\Platform\MySql\Lowering\Call\TemporalRule packages/sql-semantics-mysql/src/Lowering/Call/TemporalRule.php:50
- class-const SqlSemantics\Platform\MySql\Lowering\Call\TemporalRule packages/sql-semantics-mysql/src/Lowering/Call/TemporalRule.php:51
- class-const SqlSemantics\Platform\MySql\Lowering\Call\TemporalRule packages/sql-semantics-mysql/src/Lowering/Call/TemporalRule.php:52
- class-const SqlSemantics\Platform\MySql\Lowering\Call\TemporalRule packages/sql-semantics-mysql/src/Lowering/Call/TemporalRule.php:53
- class-const SqlSemantics\Platform\MySql\Lowering\Call\TemporalRule::currentTimestamp() packages/sql-semantics-mysql/src/Lowering/Call/TemporalRule.php:146