Skip to content

Commit

Permalink
Added SYSTEM_USER handling
Browse files Browse the repository at this point in the history
  • Loading branch information
sad-spirit committed Aug 29, 2023
1 parent acdbacc commit 7223561
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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
];

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/ParseFunctionCallTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ protected function setUp(): void
public function testNoParenthesesFunctions(): void
{
$list = $this->parser->parseExpressionList($input = <<<QRY
current_date, current_role, current_user, session_user, user, current_catalog, current_schema
current_date, current_role, current_user, session_user, user, current_catalog, current_schema, system_user
QRY
);
$expected = [];
Expand Down

0 comments on commit 7223561

Please sign in to comment.