This is an interface with conn field represents a Connection. The primary usage is to define function parameters easier:
conn
Connection
// Making the connection requiredasync function findMyEntityById( opts: ConnectionOpts & { id: number }): Promise<MyEntity | null> { const { id, conn } = opts // ...}// Making the connection optionalasync function findMyEntityById( opts: Partial<ConnectionOpts> & { id: number }): Promise<MyEntity | null> { const { id, conn = defaultConnection } = opts // ...}
Generated using TypeDoc
This is an interface with
conn
field represents aConnection
. The primary usage is to define function parameters easier: