Session functions

Table of Contents

session::db!()

The session::db!() macro returns the currently selected database.

Example:

#![allow(unused)]
fn main() {
use surreal_orm::functions::session;

session::db!();
}

session::id!()

The session::id!() macro returns the current user's session ID.

Example:

#![allow(unused)]
fn main() {
use surreal_orm::functions::session;

session::id!();
}

session::ip!()

The session::ip!() macro returns the current user's session IP address.

Example:

#![allow(unused)]
fn main() {
use surreal_orm::functions::session;

session::ip!();
}

session::ns!()

The session::ns!() macro returns the currently selected namespace.

Example:

#![allow(unused)]
fn main() {
use surreal_orm::functions::session;

session::ns!();
}

session::origin!()

The session::origin!() macro returns the current user's HTTP origin.

Example:

#![allow(unused)]
fn main() {
use surreal_orm::functions::session;

session::origin!();
}

session::sc!()

The session::sc!() macro returns the current user's authentication scope.

Example:

#![allow(unused)]
fn main() {
use surreal_orm::functions::session;

session::sc!();
}