Skip to main content
Dotset CLI API Documentation / tollgate / SqliteSessionStore

Class: SqliteSessionStore

Defined in: src/tollgate/session/sqlite-store.ts:59 SQLite-backed session store for persistent session grants. Features:
  • Sessions survive process restarts
  • Automatic cleanup of expired grants
  • Thread-safe via SQLite’s locking

Implements

Constructors

Constructor

new SqliteSessionStore(dbPath): SqliteSessionStore;
Defined in: src/tollgate/session/sqlite-store.ts:66

Parameters

dbPath
string

Returns

SqliteSessionStore

Methods

clear()

clear(): void;
Defined in: src/tollgate/session/sqlite-store.ts:159 Clear all grants

Returns

void

Implementation of

close()

close(): void;
Defined in: src/tollgate/session/sqlite-store.ts:218 Close the database connection.

Returns

void

delete()

delete(id): boolean;
Defined in: src/tollgate/session/sqlite-store.ts:138 Remove a grant

Parameters

id
string

Returns

boolean

Implementation of

findMatching()

findMatching(context): SessionGrant[];
Defined in: src/tollgate/session/sqlite-store.ts:124 Find grants that might match a context

Parameters

context

Returns

SessionGrant[]

Implementation of

get()

get(id): SessionGrant | undefined;
Defined in: src/tollgate/session/sqlite-store.ts:118 Get a grant by ID

Parameters

id
string

Returns

SessionGrant | undefined

Implementation of

getAll()

getAll(): SessionGrant[];
Defined in: src/tollgate/session/sqlite-store.ts:153 Get all active grants

Returns

SessionGrant[]

Implementation of

getStats()

getStats(): SessionStats;
Defined in: src/tollgate/session/sqlite-store.ts:163 Get statistics

Returns

Implementation of

incrementUsage()

incrementUsage(id): void;
Defined in: src/tollgate/session/sqlite-store.ts:211 Increment usage count for a grant. Called when a grant is used to authorize a tool call.

Parameters

id
string

Returns

void

pruneExpired()

pruneExpired(): number;
Defined in: src/tollgate/session/sqlite-store.ts:143 Remove all expired grants

Returns

number

Implementation of

set()

set(grant): void;
Defined in: src/tollgate/session/sqlite-store.ts:103 Store a new grant

Parameters

grant

Returns

void

Implementation of