Skip to content

Allow postgres version to be set statically #11372

@hfhchan-plb

Description

@hfhchan-plb

Feature Description

Both database and searchSchema are only set in connect() when they are not defined, but queryRunner.getVersion() is always called.

Can the call to getVersion() also be changed to be similar to the other properties?

As this field is only used to determine if generated columns are supported, it can be trivially overwritten to reduce cold start time.

The Solution

This allows consumers of this library to set the version to avoid one extra query, which will reduce cold start time which is critical in serverless applications.

Considered Alternatives

N/A

Additional Context

No response

Relevant Database Driver(s)

  • aurora-mysql
  • aurora-postgres
  • better-sqlite3
  • cockroachdb
  • cordova
  • expo
  • mongodb
  • mysql
  • nativescript
  • oracle
  • postgres
  • react-native
  • sap
  • spanner
  • sqlite
  • sqlite-abstract
  • sqljs
  • sqlserver

Are you willing to resolve this issue by submitting a Pull Request?

Yes, I have the time, and I know how to start.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions