Skip to content

Database Connectors

This directory contains auxiliary modules for direct connection to external databases. They are not independent workflow nodes with metadata.json, but function libraries that other modules can use to execute queries against third-party databases.

Each connector exposes a query function that receives the connection configuration, the query and parameters, and returns the results.

Uses the pg (Pool) library. Accepts configuration with host, user, database, password, port. Executes parameterized queries and returns result.rows.

Uses the mysql2/promise library. Creates a connection, executes the query with execute and returns the resulting rows.

Uses the mongodb (MongoClient) library. Requires configuration with url and database. The query function receives the collection name and a filter, executes find(filter).toArray().

Uses the mssql library. Requires configuration with user, password, server, database. Executes SQL queries and returns result.recordset.

ParameterTypeRequiredDescription
host / server / urltextYesDatabase server address
user / usernametextYesDatabase user
passwordtextYesPassword
databasetextYesDatabase name
portnumberNoConnection port
const pg = require('./conectores/postgresql');
const rows = await pg.query(
{ host: 'localhost', user: 'admin', database: 'mydb', password: 'pass', port: 5432 },
'SELECT * FROM users WHERE status = $1',
['active']
);
const mysql = require('./conectores/mysql');
const rows = await mysql.query(
{ host: 'localhost', user: 'root', password: 'pass', database: 'mydb' },
'SELECT * FROM orders WHERE id = ?',
[123]
);
const mongo = require('./conectores/mongodb');
const docs = await mongo.query(
{ url: 'mongodb://localhost:27017', database: 'mydb' },
'users',
{ status: 'active' }
);
const mssql = require('./conectores/sqlserver');
const rows = await mssql.query(
{ user: 'sa', password: 'pass', server: 'localhost', database: 'mydb' },
'SELECT TOP 10 * FROM Products'
);
  • These modules do not have metadata.json and do not appear as nodes in the visual editor
  • They are low-level utilities intended to be used by other workflow modules
  • Connections are automatically closed after each query
  • PostgreSQL uses Pool which closes with pool.end()
  • MySQL creates a new connection per query and closes it upon completion
  • MongoDB uses MongoClient.connect and closes with client.close()
  • SQL Server uses mssql.connect and manages the pool internally
  • They do not include integrated credential management; configuration is passed directly
  • Integration modules that require direct access to external databases