Database Utility
The createPool function creates a PostgreSQL connection pool for use with the job queue system.
This utility is only relevant for the PostgreSQL backend. If you're using the Redis backend, you don't need this function.
Function
createPool(config: PostgresJobQueueConfig['databaseConfig']): Poolconfig: The database connection configuration (connection string, host, port, database, user, password, ssl).- Returns a
Poolinstance frompg.
Example
import { createPool } from '@nicnocquee/dataqueue';
const pool = createPool({
host: 'localhost',
port: 5432,
database: 'mydb',
user: 'postgres',
password: 'secret',
});