Defining Upstream
You can add application-wide upstream targets by using Upstream.add
.
The supported connectors are:
UpstreamDatastorePostgres
UpstreamDatastoreSqlite
UpstreamDatastoreRedis
UpstreamDatastoreMongo
Adding Upstream
import { Upstream } from 'ts-basis'
await push(myobj) // ERROR! No upstream defined yet
// Adding different datastores
Upstream.add(new UpstreamDatastorePostgres(localPostgresDsConfig))
// Admin operations to define data table
Upstream.admin(TestClassData).dropCollection()
Upstream.admin(TestClassData).recreateIndexes()
await push(myobj) // success