PgCollectionStore
PostgreSQL implementation of CollectionStore.
Manages the collection hierarchy with permission inheritance.
Value parameters
- getConnection
-
Function to obtain a database connection
- vectorTableName
-
Name of the vectors table (for document/chunk counts)
Attributes
- Graph
-
- Supertypes
Members list
Value members
Concrete methods
Check if a user can query a collection.
Check if a user can query a collection.
This considers the effective permissions (with inheritance).
Value parameters
- auth
-
The user's authorization context
- path
-
The collection path
Attributes
- Returns
-
True if the user can query this collection
- Definition Classes
Count chunks in a collection.
Count chunks in a collection.
Value parameters
- path
-
The collection path
Attributes
- Returns
-
Number of chunks
- Definition Classes
Count documents in a collection.
Count documents in a collection.
Value parameters
- path
-
The collection path
Attributes
- Returns
-
Number of documents (not chunks)
- Definition Classes
Create a new collection.
Create a new collection.
Validates that:
- The parent exists (if not a root collection)
- Permissions don't loosen parent restrictions
- The path is valid and not already taken
Value parameters
- config
-
The collection configuration
Attributes
- Returns
-
The created collection, or error
- Definition Classes
Delete a collection.
Delete a collection.
The collection must be empty (no documents or sub-collections).
Value parameters
- path
-
The collection path
Attributes
- Returns
-
Success or error
- Definition Classes
Ensure a collection exists, creating it if necessary.
Ensure a collection exists, creating it if necessary.
Creates parent collections as needed (as public, non-leaf).
Value parameters
- config
-
The collection configuration
Attributes
- Returns
-
The existing or newly created collection
- Definition Classes
Find collections accessible by user matching a pattern.
Find collections accessible by user matching a pattern.
This is the key permission-filtered query used during search. Returns only collections where:
- Pattern matches, AND
- User has access (public OR user's principals overlap with queryableBy)
Also respects inheritance - if a parent is not accessible, its children are also not accessible.
Value parameters
- auth
-
The user's authorization context
- pattern
-
The pattern to match
Attributes
- Returns
-
Accessible collections matching the pattern
- Definition Classes
Get a collection by path.
Get a collection by path.
Value parameters
- path
-
The collection path
Attributes
- Returns
-
The collection if found, None otherwise
- Definition Classes
Get a collection by its database ID.
Get a collection by its database ID.
Value parameters
- id
-
The collection ID
Attributes
- Returns
-
The collection if found, None otherwise
- Definition Classes
Get effective permissions for a collection considering inheritance.
Get effective permissions for a collection considering inheritance.
Effective permissions are the intersection of:
- The collection's own queryableBy, AND
- All ancestor collections' queryableBy sets
If any ancestor is public (empty queryableBy), that level is skipped. If the collection itself is public, returns empty (meaning public).
Value parameters
- path
-
The collection path
Attributes
- Returns
-
The effective permissions set
- Definition Classes
List all collections matching a pattern.
List all collections matching a pattern.
Does NOT apply permission filtering - returns all matching collections. Use findAccessible for permission-filtered queries.
Value parameters
- pattern
-
The pattern to match (default: all)
Attributes
- Returns
-
All matching collections
- Definition Classes
List direct children of a collection.
List direct children of a collection.
Value parameters
- parentPath
-
The parent collection path
Attributes
- Returns
-
Direct child collections
- Definition Classes
Get collection statistics.
Get collection statistics.
Value parameters
- path
-
The collection path
Attributes
- Returns
-
Collection statistics
- Definition Classes
Update collection metadata.
Update collection metadata.
Value parameters
- metadata
-
The new metadata (replaces existing)
- path
-
The collection path
Attributes
- Returns
-
The updated collection, or error
- Definition Classes
Update collection permissions.
Update collection permissions.
Validates that new permissions don't loosen parent restrictions.
Value parameters
- path
-
The collection path
- queryableBy
-
The new set of queryable principals
Attributes
- Returns
-
The updated collection, or error
- Definition Classes
Inherited methods
Check if a collection exists.
Check if a collection exists.
Value parameters
- path
-
The collection path
Attributes
- Returns
-
True if exists
- Inherited from:
- CollectionStore