FaasJS
Home
  • Guide
  • Documents
  • Templates
  • Changelog
  • Ecosystem

    • Docker Images
  • Github
  • Contributing
  • Sponsor
  • Security
Home
  • Guide
  • Documents
  • Templates
  • Changelog
  • Ecosystem

    • Docker Images
  • Github
  • Contributing
  • Sponsor
  • Security

Documents / @faasjs/pg / DatabaseBootstrap

Type Alias: DatabaseBootstrap

DatabaseBootstrap = () => void | Promise<void>

Async bootstrap used by getClient when no default client has been cached yet.

The bootstrap is responsible for initializing and caching the default client. The built-in bootstrap creates that client from process.env.DATABASE_URL, while tools such as @faasjs/pg-dev can register a lazy async bootstrap for tests. A custom bootstrap should call createClient exactly once for the default connection path so getClient() can resolve a single cached client afterwards.

Returns

void | Promise<void>