Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions pages/querying/functions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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) -> (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 |
| --------------- | ---------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
Expand Down