mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 21:00:58 +03:00
Migrating all TLS/SSL settings into additionalConfig so that there is consistency in how every function connects with Postgres in the same manner.
This commit is contained in:
@@ -60,13 +60,6 @@ class Postgres_VectorStores implements INode {
|
|||||||
name: 'database',
|
name: 'database',
|
||||||
type: 'string'
|
type: 'string'
|
||||||
},
|
},
|
||||||
{
|
|
||||||
label: 'SSL Connection',
|
|
||||||
name: 'sslConnection',
|
|
||||||
type: 'boolean',
|
|
||||||
default: false,
|
|
||||||
optional: false
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
label: 'Port',
|
label: 'Port',
|
||||||
name: 'port',
|
name: 'port',
|
||||||
@@ -124,7 +117,6 @@ class Postgres_VectorStores implements INode {
|
|||||||
const docs = nodeData.inputs?.document as Document[]
|
const docs = nodeData.inputs?.document as Document[]
|
||||||
const embeddings = nodeData.inputs?.embeddings as Embeddings
|
const embeddings = nodeData.inputs?.embeddings as Embeddings
|
||||||
const additionalConfig = nodeData.inputs?.additionalConfig as string
|
const additionalConfig = nodeData.inputs?.additionalConfig as string
|
||||||
const sslConnection = nodeData.inputs?.sslConnection as boolean
|
|
||||||
|
|
||||||
let additionalConfiguration = {}
|
let additionalConfiguration = {}
|
||||||
if (additionalConfig) {
|
if (additionalConfig) {
|
||||||
@@ -143,7 +135,6 @@ class Postgres_VectorStores implements INode {
|
|||||||
username: user,
|
username: user,
|
||||||
password: password,
|
password: password,
|
||||||
database: nodeData.inputs?.database as string,
|
database: nodeData.inputs?.database as string,
|
||||||
ssl: sslConnection
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const args = {
|
const args = {
|
||||||
@@ -248,15 +239,7 @@ const similaritySearchVectorWithScore = async (
|
|||||||
ORDER BY "_distance" ASC
|
ORDER BY "_distance" ASC
|
||||||
LIMIT $3;`
|
LIMIT $3;`
|
||||||
|
|
||||||
const poolOptions = {
|
const pool = new Pool(postgresConnectionOptions)
|
||||||
host: postgresConnectionOptions.host,
|
|
||||||
port: postgresConnectionOptions.port,
|
|
||||||
user: postgresConnectionOptions.username,
|
|
||||||
password: postgresConnectionOptions.password,
|
|
||||||
database: postgresConnectionOptions.database,
|
|
||||||
ssl: postgresConnectionOptions.extra?.ssl
|
|
||||||
}
|
|
||||||
const pool = new Pool(poolOptions)
|
|
||||||
const conn = await pool.connect()
|
const conn = await pool.connect()
|
||||||
|
|
||||||
const documents = await conn.query(queryString, [embeddingString, _filter, k])
|
const documents = await conn.query(queryString, [embeddingString, _filter, k])
|
||||||
|
|||||||
Reference in New Issue
Block a user