Skip to main content

Module session

Module session 

Source
Expand description

The settings statements run under on a session: the service’s schema first on the search path, the statement’s time bound, and the role it runs as. Whatever holds the session sends these texts, so the platform’s sessions, its migration executor and the native test host set up a session alike.

Enums§

Scope
Where a session’s settings apply.

Constants§

MIGRATION_RESET
Undoes a Scope::Session migration_prelude.
ROLE_NONE
Ends the role a migration ran as within its transaction, so the history row is written as the session’s own role.

Functions§

migration_prelude
What a service’s SQL migrations run under: its schema, the statement and lock time bounds, and the role the migrations run as where the run imposes one.
prelude
What a guest’s statements run under: the schema is written as every statement writes it (folded_ident), so the path a guest’s SQL resolves in, the schema a deploy created and the one a migration ran in are the same schema. role is the one a session imposes on its connection, where it does.
quote_ident
name as a quoted SQL identifier, exactly as written.
reset
Undoes a Scope::Session prelude.
set_role
SET LOCAL ROLE or SET ROLE, as scope says.