org.llm4s.rag.permissions.pg
Members list
Type members
Classlikes
Statistics from a schema migration.
Statistics from a schema migration.
Value parameters
- defaultCollectionId
-
ID of the default collection
- indexesCreated
-
Number of indexes created
- tablesCreated
-
Number of tables created
- vectorsMigrated
-
Number of vectors migrated to the default collection
Attributes
- Source
- PgSchemaManager.scala
- Supertypes
PostgreSQL implementation of CollectionStore.
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
- Source
- PgCollectionStore.scala
- Supertypes
PostgreSQL implementation of PrincipalStore.
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
- Source
- PgPrincipalStore.scala
- Supertypes
Manages the PostgreSQL schema for permission-based RAG.
Manages the PostgreSQL schema for permission-based RAG.
Creates and maintains the database tables required for:
- Principal ID mapping (users and groups to integers)
- Collection hierarchy with permissions
- Extended vectors table with collection_id and readable_by
Attributes
- Source
- PgSchemaManager.scala
- Supertypes
- Self type
-
PgSchemaManager.type
PostgreSQL implementation of SearchIndex with permission-based filtering.
PostgreSQL implementation of SearchIndex with permission-based filtering.
Uses a JDBC connection pool - one it creates with HikariCP, or a caller-owned javax.sql.DataSource (see PgSearchIndex.fromDataSource) - and pgvector for efficient vector similarity search.
The implementation:
- Extends the vectors table with collection_id and readable_by columns
- Uses GIN indexes for efficient array containment queries
- Applies two-level permission filtering (collection + document)
- Gracefully handles corrupt embeddings without failing queries
Corrupt Embedding Handling:
- Records with unparseable embeddings are skipped during query operations
- Corrupt records are logged with id and embedding_dim for debugging
- Queries continue successfully and return topK valid results
- No silent data corruption - failures are observable via logs
Value parameters
- _pgConfig
-
the configuration the index's pool was built from, if it built one
- dataSource
-
JDBC connection pool
- ownsDataSource
-
whether close closes
dataSource - vectorTableName
-
Name of the vectors table
Attributes
- Companion
- object
- Source
- PgSearchIndex.scala
- Supertypes
Attributes
- Companion
- class
- Source
- PgSearchIndex.scala
- Supertypes
- Self type
-
PgSearchIndex.type
