diff --git a/Changelog.md b/Changelog.md index 50b6297..8f555f7 100644 --- a/Changelog.md +++ b/Changelog.md @@ -11,6 +11,7 @@ Support new syntax of PostgreSQL 16 (as of beta 3) `nodes\json\JsonObjectAgg`; * Constructor functions `json_array()` and `json_object()` represented by `nodes\json\JsonArrayValueList`, `nodes\json\JsonArraySubselect`, `nodes\json\JsonObject` classes. + * `SYSTEM_USER` server variable backed by `nodes\expressions\SQLValueFunction`. ## [2.2.0] - 2023-05-14 diff --git a/src/sad_spirit/pg_builder/nodes/expressions/SQLValueFunction.php b/src/sad_spirit/pg_builder/nodes/expressions/SQLValueFunction.php index 904d67d..cdcc165 100644 --- a/src/sad_spirit/pg_builder/nodes/expressions/SQLValueFunction.php +++ b/src/sad_spirit/pg_builder/nodes/expressions/SQLValueFunction.php @@ -51,6 +51,7 @@ class SQLValueFunction extends GenericNode implements FunctionLike, ScalarExpres public const USER = 'user'; public const CURRENT_CATALOG = 'current_catalog'; public const CURRENT_SCHEMA = 'current_schema'; + public const SYSTEM_USER = 'system_user'; public const CURRENT_TIME = 'current_time'; public const CURRENT_TIMESTAMP = 'current_timestamp'; @@ -67,7 +68,8 @@ class SQLValueFunction extends GenericNode implements FunctionLike, ScalarExpres self::SESSION_USER, self::USER, self::CURRENT_CATALOG, - self::CURRENT_SCHEMA + self::CURRENT_SCHEMA, + self::SYSTEM_USER ]; /** diff --git a/tests/ParseFunctionCallTest.php b/tests/ParseFunctionCallTest.php index b4a9439..76ac9e1 100644 --- a/tests/ParseFunctionCallTest.php +++ b/tests/ParseFunctionCallTest.php @@ -105,7 +105,7 @@ protected function setUp(): void public function testNoParenthesesFunctions(): void { $list = $this->parser->parseExpressionList($input = <<