Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface ConnectionOpts

This is an interface with conn field represents a Connection. The primary usage is to define function parameters easier:

// Making the connection required
async function findMyEntityById(
opts: ConnectionOpts & { id: number }
): Promise<MyEntity | null> {
const { id, conn } = opts
// ...
}

// Making the connection optional
async function findMyEntityById(
opts: Partial<ConnectionOpts> & { id: number }
): Promise<MyEntity | null> {
const { id, conn = defaultConnection } = opts
// ...
}

Hierarchy

  • ConnectionOpts

Index

Properties

Properties

Generated using TypeDoc