PgPrincipalStore
PostgreSQL implementation of PrincipalStore.
Uses the llm4s_principals table to map external identifiers to internal integer IDs:
- User IDs are positive (from SERIAL auto-increment)
- Group IDs are negative (from llm4s_group_id_seq sequence)
Value parameters
- getConnection
-
Function to obtain a database connection
Attributes
- Graph
-
- Supertypes
Members list
Value members
Concrete methods
Count principals of a given type.
Count principals of a given type.
Value parameters
- principalType
-
Either "user" or "group"
Attributes
- Returns
-
Count of principals
- Definition Classes
Delete a principal mapping.
Delete a principal mapping.
Note: This does not remove the principal from any collection permissions or document readable_by lists. Those should be cleaned up separately.
Value parameters
- external
-
The external principal identifier
Attributes
- Returns
-
Success or error
- Definition Classes
Reverse lookup: get external ID for a principal ID.
Reverse lookup: get external ID for a principal ID.
Value parameters
- id
-
The internal principal ID
Attributes
- Returns
-
The external principal if found, None otherwise
- Definition Classes
Get or create a principal ID for an external identifier.
Get or create a principal ID for an external identifier.
If the external ID already exists, returns the existing ID. Otherwise, creates a new ID (positive for users, negative for groups).
Value parameters
- external
-
The external principal identifier
Attributes
- Returns
-
The internal principal ID
- Definition Classes
Batch get or create for multiple principals.
Batch get or create for multiple principals.
More efficient than individual calls for bulk operations.
Value parameters
- externals
-
The external principal identifiers
Attributes
- Returns
-
Map from external principal to internal ID
- Definition Classes
List all principals of a given type.
List all principals of a given type.
Value parameters
- limit
-
Maximum number to return
- offset
-
Number to skip
- principalType
-
Either "user" or "group"
Attributes
- Returns
-
List of external principals
- Definition Classes
Lookup principal by external ID without creating.
Lookup principal by external ID without creating.
Value parameters
- external
-
The external principal identifier
Attributes
- Returns
-
The internal ID if found, None otherwise
- Definition Classes
Lookup multiple principals by external IDs.
Lookup multiple principals by external IDs.
Only returns mappings for principals that exist.
Value parameters
- externals
-
The external principal identifiers
Attributes
- Returns
-
Map from external principal to internal ID (only for existing principals)
- Definition Classes
Inherited methods
Check if a principal exists.
Check if a principal exists.
Value parameters
- external
-
The external principal identifier
Attributes
- Returns
-
True if exists, false otherwise
- Inherited from:
- PrincipalStore