feat: Add SSL configuration option for Postgres connections (#4130)

Update README files for Postgres Record Manager and Vector Store to include a new SSL environment variable, allowing optional SSL configuration for database connections
This commit is contained in:
Michael Young
2025-03-13 03:57:38 -07:00
committed by GitHub
parent 9d9aaaa886
commit 4130156397
8 changed files with 52 additions and 19 deletions
@@ -2,7 +2,7 @@ import { VectorStore } from '@langchain/core/vectorstores'
import { getCredentialData, getCredentialParam, ICommonObject, INodeData } from '../../../../src'
import { Document } from '@langchain/core/documents'
import { Embeddings } from '@langchain/core/embeddings'
import { getDatabase, getHost, getPort, getTableName } from '../utils'
import { getDatabase, getHost, getPort, getSSL, getTableName } from '../utils'
export abstract class VectorStoreDriver {
constructor(protected nodeData: INodeData, protected options: ICommonObject) {}
@@ -23,6 +23,10 @@ export abstract class VectorStoreDriver {
return getPort(this.nodeData) as number
}
getSSL() {
return getSSL(this.nodeData) as boolean
}
getDatabase() {
return getDatabase(this.nodeData) as string
}
@@ -29,6 +29,7 @@ export class TypeORMDriver extends VectorStoreDriver {
type: 'postgres',
host: this.getHost(),
port: this.getPort(),
ssl: this.getSSL(),
username: user, // Required by TypeORMVectorStore
user: user, // Required by Pool in similaritySearchVectorWithScore
password: password,