Postgres
@node-ts/bus-postgres provides a persistence adapter based on Postgres that's used when storing workflow state.

Installation

Install the @node-ts/bus-postgres package
1
npm install @node-ts/bus-postgres
Copied!
Create a new PostgresPersistence instance and provide it to the bus configuration.
1
import { Bus } from '@node-ts/bus-core'
2
import { PostgresPersistence, PostgresConfiguration } from '@node-ts/bus-postgres'
3
​
4
const postgresConfiguration: PostgresConfiguration = {
5
connection: {
6
connectionString: 'postgres://postgres:[email protected]:5432/postgres'
7
},
8
schemaName: 'workflows'
9
}
10
const postgresPersistence = new PostgresPersistence(postgresConfiguration)
11
await Bus
12
.configure()
13
.withPersistence(postgresPersistence)
14
.initialize()
Copied!
Copy link
Contents
Installation