auth/role_grant_sql.ts

The liveness predicates of role_grant and role_grant_offer — one spelling each, so a new terminal state or liveness condition lands in one place instead of at every query that filters on it.

Twins of the Rust spine's role_grant_active_sql and offer_pending_predicate (with its OFFER_TERMINAL_COLUMNS). The frozen partial-index DDL (auth/role_grant_offer_ddl.ts, auth/migrations.ts) keeps its literal predicate text, since a migration body never changes.

view source

Declarations
#

3 declarations

offer_pending_predicate
#

auth/role_grant_sql.ts view source

(alias: string): string import {offer_pending_predicate} from '@fuzdev/fuz_app/auth/role_grant_sql.js';

The still-pending predicate for a role grant offer — every OFFER_TERMINAL_COLUMNS entry IS NULL, AND-joined.

Expiry is not part of it: an expired offer that no sweep has terminated is still pending here, and each read that must refuse one adds its own expires_at condition.

alias

the table alias qualifying the columns, or '' for unqualified columns

type string

returns

string

the predicate, with no surrounding parentheses

OFFER_TERMINAL_COLUMNS
#

auth/role_grant_sql.ts view source

readonly ["accepted_at", "declined_at", "retracted_at", "superseded_at"] import {OFFER_TERMINAL_COLUMNS} from '@fuzdev/fuz_app/auth/role_grant_sql.js';

The role_grant_offer timestamp columns that each end an offer. An offer is pending while every one is null.

role_grant_active_sql
#

auth/role_grant_sql.ts view source

(alias: string): string import {role_grant_active_sql} from '@fuzdev/fuz_app/auth/role_grant_sql.js';

The SQL predicate for an active role grant: not revoked and not expired.

The grant row's own liveness only. Whether its holder is live — the actor and its account not soft-deleted, which doesn't revoke grants — is a join the caller adds where the read needs it.

alias

the table alias qualifying the columns, or '' for unqualified columns

type string

returns

string

the predicate, with no surrounding parentheses (it is a top-level AND chain)

Imported by
#