enumValueFunctionKind
enum ValueFunctionKind: string
@visibility public.The SQL-standard functions written as a bare keyword.
Mirrors PostgreSQL's SQLValueFunctionOp, plus SYSTEM_USER, which the server turns into a call of pg_catalog.system_user(). CURRENT_ROLE and CURRENT_USER, and USER, are distinct spellings the server keeps apart. Source: https://www.postgresql.org/docs/17/functions-datetime.html#FUNCTIONS-DATETIME-CURRENT, https://www.postgresql.org/docs/17/functions-info.html#FUNCTIONS-INFO-SESSION.
\SqlSemantics\Platform\PostgreSql\Statement\Invocation\Syntax\ValueFunctionKind::CurrentDate->builtin() // => \SqlSemantics\Platform\PostgreSql\Statement\Type\Descriptor\Builtin::DateCases§
case CurrentDate = 'CURRENT_DATE'case CurrentTime = 'CURRENT_TIME'case CurrentTimestamp = 'CURRENT_TIMESTAMP'case Localtime = 'LOCALTIME'case Localtimestamp = 'LOCALTIMESTAMP'case CurrentRole = 'CURRENT_ROLE'case CurrentUser = 'CURRENT_USER'case SessionUser = 'SESSION_USER'case SystemUser = 'SYSTEM_USER'case User = 'USER'case CurrentCatalog = 'CURRENT_CATALOG'case CurrentSchema = 'CURRENT_SCHEMA'Methods§
public function precise(): boolTells whether the function takes a fractional-seconds precision in parentheses.
Returns
boolCalled from 1
Calls 12
- class-const ValueFunctionKind::CurrentTime() line 43
- class-const ValueFunctionKind::CurrentTimestamp() line 43
- class-const ValueFunctionKind::Localtime() line 43
- class-const ValueFunctionKind::Localtimestamp() line 43
- class-const ValueFunctionKind::CurrentDate() line 44
- class-const ValueFunctionKind::CurrentRole() line 44
- class-const ValueFunctionKind::CurrentUser() line 44
- class-const ValueFunctionKind::SessionUser() line 44
- class-const ValueFunctionKind::SystemUser() line 44
- class-const ValueFunctionKind::User() line 44
- class-const ValueFunctionKind::CurrentCatalog() line 44
- class-const ValueFunctionKind::CurrentSchema() line 44
public function builtin(): BuiltinAnswers the type of the result.
Returns
Called from 1
Calls 19
- class-const ValueFunctionKind::CurrentDate() line 54
- class-const Builtin::Date() line 54
- class-const ValueFunctionKind::CurrentTime() line 55
- class-const Builtin::Timetz() line 55
- class-const ValueFunctionKind::CurrentTimestamp() line 56
- class-const Builtin::Timestamptz() line 56
- class-const ValueFunctionKind::Localtime() line 57
- class-const Builtin::Time() line 57
- class-const ValueFunctionKind::Localtimestamp() line 58
- class-const Builtin::Timestamp() line 58
- class-const ValueFunctionKind::SystemUser() line 59
- class-const Builtin::Text() line 59
- class-const ValueFunctionKind::CurrentRole() line 60
- class-const ValueFunctionKind::CurrentUser() line 60
- class-const ValueFunctionKind::SessionUser() line 60
- class-const ValueFunctionKind::User() line 60
- class-const ValueFunctionKind::CurrentCatalog() line 60
- class-const ValueFunctionKind::CurrentSchema() line 60
- class-const Builtin::Name() line 60
public function nullable(): boolTells whether the result can be NULL: CURRENT_SCHEMA when no schema of the path exists, SYSTEM_USER for a session that was not authenticated.
Returns
boolCalled from 1
Calls 2
- class-const ValueFunctionKind::CurrentSchema() line 69
- class-const ValueFunctionKind::SystemUser() line 69
Test cases 9§
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 6
ValueFunctionTest::testDeriveScalarMakesCurrentSchemaNullablecallsValueFunctionTest::testDeriveScalarReducesThePrecisionToSixcallsValueFunctionTest::testOutputNameIsTheKeywordInLowerCasecallsValueFunctionTest::testRejectsAPrecisionOnANameFunctioncallsValueFunctionTest::testRenderWritesTheKeywordAndThePrecisioncallsExtractTest::testDeriveScalarIsNumericForADatecalls
Relations§
Method calls 3
- method-call SqlSemantics\Platform\PostgreSql\Statement\Invocation\Syntax\ValueFunction::__construct() packages/sql-semantics-postgres/src/Statement/Invocation/Syntax/ValueFunction.php:61
- method-call SqlSemantics\Platform\PostgreSql\Statement\Invocation\Syntax\ValueFunction::deriveScalar() packages/sql-semantics-postgres/src/Statement/Invocation/Syntax/ValueFunction.php:77
- method-call SqlSemantics\Platform\PostgreSql\Statement\Invocation\Syntax\ValueFunction::deriveScalar() packages/sql-semantics-postgres/src/Statement/Invocation/Syntax/ValueFunction.php:78
Constant reads 16
- class-const SqlSemantics\Platform\PostgreSql\Lowering\Invocation\SyntaxRule packages/sql-semantics-postgres/src/Lowering/Invocation/SyntaxRule.php:45
- class-const SqlSemantics\Platform\PostgreSql\Lowering\Invocation\SyntaxRule packages/sql-semantics-postgres/src/Lowering/Invocation/SyntaxRule.php:46
- class-const SqlSemantics\Platform\PostgreSql\Lowering\Invocation\SyntaxRule packages/sql-semantics-postgres/src/Lowering/Invocation/SyntaxRule.php:47
- class-const SqlSemantics\Platform\PostgreSql\Lowering\Invocation\SyntaxRule packages/sql-semantics-postgres/src/Lowering/Invocation/SyntaxRule.php:48
- class-const SqlSemantics\Platform\PostgreSql\Lowering\Invocation\SyntaxRule packages/sql-semantics-postgres/src/Lowering/Invocation/SyntaxRule.php:49
- class-const SqlSemantics\Platform\PostgreSql\Lowering\Invocation\SyntaxRule packages/sql-semantics-postgres/src/Lowering/Invocation/SyntaxRule.php:50
- class-const SqlSemantics\Platform\PostgreSql\Lowering\Invocation\SyntaxRule packages/sql-semantics-postgres/src/Lowering/Invocation/SyntaxRule.php:51
- class-const SqlSemantics\Platform\PostgreSql\Lowering\Invocation\SyntaxRule packages/sql-semantics-postgres/src/Lowering/Invocation/SyntaxRule.php:52
- class-const SqlSemantics\Platform\PostgreSql\Lowering\Invocation\SyntaxRule packages/sql-semantics-postgres/src/Lowering/Invocation/SyntaxRule.php:53
- class-const SqlSemantics\Platform\PostgreSql\Lowering\Invocation\SyntaxRule packages/sql-semantics-postgres/src/Lowering/Invocation/SyntaxRule.php:54
- class-const SqlSemantics\Platform\PostgreSql\Lowering\Invocation\SyntaxRule packages/sql-semantics-postgres/src/Lowering/Invocation/SyntaxRule.php:55
- class-const SqlSemantics\Platform\PostgreSql\Lowering\Invocation\SyntaxRule packages/sql-semantics-postgres/src/Lowering/Invocation/SyntaxRule.php:56
- class-const SqlSemantics\Platform\PostgreSql\Lowering\Invocation\SyntaxRule packages/sql-semantics-postgres/src/Lowering/Invocation/SyntaxRule.php:63
- class-const SqlSemantics\Platform\PostgreSql\Lowering\Invocation\SyntaxRule packages/sql-semantics-postgres/src/Lowering/Invocation/SyntaxRule.php:64
- class-const SqlSemantics\Platform\PostgreSql\Lowering\Invocation\SyntaxRule packages/sql-semantics-postgres/src/Lowering/Invocation/SyntaxRule.php:65
- class-const SqlSemantics\Platform\PostgreSql\Lowering\Invocation\SyntaxRule packages/sql-semantics-postgres/src/Lowering/Invocation/SyntaxRule.php:66