interface PostgresStoreConfig {
    connectionOptions: string | PoolConfig;
    ensureTables?: boolean;
    index?: IndexConfig;
    schema?: string;
    textSearchLanguage?: string;
    ttl?: TTLConfig;
}

属性

connectionOptions: string | PoolConfig

PostgreSQL 连接字符串或连接配置对象。

示例

// Connection string
"postgresql://user:password@localhost:5432/database"

// Configuration object
{
host: "localhost",
port: 5432,
database: "mydb",
user: "postgres",
password: "password"
}
ensureTables?: boolean

是否在表不存在时自动创建表。

默认值

true
index?: IndexConfig

用于语义搜索功能的向量搜索配置。如果提供,则使用 pgvector 扩展启用向量相似性搜索。

schema?: string

用于存储表的数据库模式名称。

默认值

"public"
textSearchLanguage?: string

用于 PostgreSQL 全文搜索操作的语言。支持 PostgreSQL 中可用的任何语言配置。

默认值

"english"
ttl?: TTLConfig

用于项目自动过期的 TTL 配置。