org.llm4s.rag.permissions.pg

Members list

Type members

Classlikes

final case class MigrationStats(tablesCreated: Int, indexesCreated: Int, defaultCollectionId: Int, vectorsMigrated: Long)

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

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final class PgCollectionStore(getConnection: () => Connection, vectorTableName: String) extends CollectionStore

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

Supertypes
class Object
trait Matchable
class Any
final class PgPrincipalStore(getConnection: () => Connection) extends PrincipalStore

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

Supertypes
class Object
trait Matchable
class Any

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

Supertypes
class Object
trait Matchable
class Any
Self type
final class PgSearchIndex extends SearchIndex

PostgreSQL implementation of SearchIndex with permission-based filtering.

PostgreSQL implementation of SearchIndex with permission-based filtering.

Uses HikariCP for connection pooling and pgvector for efficient vector similarity search.

The implementation:

  1. Extends the vectors table with collection_id and readable_by columns
  2. Uses GIN indexes for efficient array containment queries
  3. Applies two-level permission filtering (collection + document)

Value parameters

dataSource

HikariCP data source for connection pooling

vectorTableName

Name of the vectors table

Attributes

Companion
object
Supertypes
trait SearchIndex
class Object
trait Matchable
class Any
object PgSearchIndex

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type