Skip to content

Commit

Permalink
DOC 231: Update function descriptions for session::x (#752)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ekwuno authored Aug 8, 2024
1 parent fc2bdd0 commit aad93e3
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,24 +63,24 @@ RETURN session::db();

## `session::id`

The `session::db` function returns the currently selected database.
The `session::id` function returns the current user's session ID.

```surql title="API DEFINITION"
session::db() -> string
session::id() -> string
```
The following example shows this function, and its output, when used in a [`RETURN`](/docs/surrealdb/surrealql/statements/return) statement:

```surql
RETURN session::db();
RETURN session::id();
"my_db"
"I895rKuixHwCNIduyBIYH2M0Pga7oUmWnng5exEE4a7EB942GVElGrnRhE5scF5d"
```

<br />

## `session::ip`

The `session::ip` function returns the currently selected database.
The `session::ip` function returns the current user's session IP address.

```surql title="API DEFINITION"
session::ip() -> string
Expand Down Expand Up @@ -131,15 +131,15 @@ RETURN session::origin();

## `session::ac`

The `session::ac` function returns the current user's access method.
The `session::ac` function replaces the `session::sc` function and returns the current user's access method.

```surql title="API DEFINITION"
session::sc() -> string
session::ac() -> string
```
The following example shows this function, and its output, when used in a [`RETURN`](/docs/surrealdb/surrealql/statements/return) statement:

```surql
RETURN session::sc();
RETURN session::ac();
"user"
```
Expand Down

0 comments on commit aad93e3

Please sign in to comment.