From ef8b26dcd848a71ea0de799edc8d9b4034cf5ce6 Mon Sep 17 00:00:00 2001 From: imilinovic Date: Wed, 24 Dec 2025 15:39:16 +0100 Subject: [PATCH 1/3] docs --- pages/querying/functions.mdx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pages/querying/functions.mdx b/pages/querying/functions.mdx index 08cf8e118..39533dd82 100644 --- a/pages/querying/functions.mdx +++ b/pages/querying/functions.mdx @@ -63,6 +63,13 @@ This section contains the list of supported functions. | `timestamp` | `timestamp() -> (integer)` | Returns the difference, measured in microseconds, between the current time and midnight, January 1, 1970 UTC. | | `valueType` | `valueType(any) -> (string)` | Returns the value type of the object provided in textual format. | +### Auth functions + + | Name | Signature | Description | + | --------------- | ---------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | + | `username` | `username() -> (string)` | Returns the username of the current user. Returns `null` if no user is authenticated or if the user has no username. In triggers, returns the username of the user who invoked the trigger. | + | `roles` | `roles(db_name: string = null) -> (List[string])` | Returns a list of role names assigned to the current user. If `db_name` is provided, returns only roles assigned for that specific database. If `db_name` is omitted or `null`, returns all roles assigned to the user across all databases. Returns an empty list if no user is authenticated or if the user has no roles. In triggers, returns the roles of the user who invoked the trigger. | + ### Pattern functions | Name | Signature | Description | | --------------- | ---------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | From ea83248f2cdb8b5cd8c1f9616869b65266ca6aa2 Mon Sep 17 00:00:00 2001 From: imilinovic Date: Wed, 24 Dec 2025 15:45:16 +0100 Subject: [PATCH 2/3] docs --- pages/querying/functions.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/querying/functions.mdx b/pages/querying/functions.mdx index 39533dd82..c2fed99fa 100644 --- a/pages/querying/functions.mdx +++ b/pages/querying/functions.mdx @@ -68,7 +68,7 @@ This section contains the list of supported functions. | Name | Signature | Description | | --------------- | ---------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `username` | `username() -> (string)` | Returns the username of the current user. Returns `null` if no user is authenticated or if the user has no username. In triggers, returns the username of the user who invoked the trigger. | - | `roles` | `roles(db_name: string = null) -> (List[string])` | Returns a list of role names assigned to the current user. If `db_name` is provided, returns only roles assigned for that specific database. If `db_name` is omitted or `null`, returns all roles assigned to the user across all databases. Returns an empty list if no user is authenticated or if the user has no roles. In triggers, returns the roles of the user who invoked the trigger. | + | `roles` | `roles(db_name?: string) -> (List[string])` | Returns a list of role names assigned to the current user. The `db_name` parameter is optional. If provided, it must be a string and returns only roles assigned for that specific database. If omitted, returns all roles assigned to the user across all databases. Returns an empty list if no user is authenticated or if the user has no roles. In triggers, returns the roles of the user who invoked the trigger. | ### Pattern functions | Name | Signature | Description | From 9c363907ee3c96f4261c5e4188c1b6d68bc56052 Mon Sep 17 00:00:00 2001 From: imilinovic Date: Wed, 24 Dec 2025 15:46:25 +0100 Subject: [PATCH 3/3] docs --- pages/querying/functions.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/querying/functions.mdx b/pages/querying/functions.mdx index c2fed99fa..dc8851256 100644 --- a/pages/querying/functions.mdx +++ b/pages/querying/functions.mdx @@ -68,7 +68,7 @@ This section contains the list of supported functions. | Name | Signature | Description | | --------------- | ---------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `username` | `username() -> (string)` | Returns the username of the current user. Returns `null` if no user is authenticated or if the user has no username. In triggers, returns the username of the user who invoked the trigger. | - | `roles` | `roles(db_name?: string) -> (List[string])` | Returns a list of role names assigned to the current user. The `db_name` parameter is optional. If provided, it must be a string and returns only roles assigned for that specific database. If omitted, returns all roles assigned to the user across all databases. Returns an empty list if no user is authenticated or if the user has no roles. In triggers, returns the roles of the user who invoked the trigger. | + | `roles` | `roles(db_name?: string) -> (List[string])` | Returns a list of role names assigned to the current user. The `db_name` parameter is optional. If provided, returns only roles assigned for that specific database. If omitted, returns all roles assigned to the user across all databases. Returns an empty list if no user is authenticated or if the user has no roles. In triggers, returns the roles of the user who invoked the trigger. | ### Pattern functions | Name | Signature | Description |