Type helper for making certain fields of an object optional.

interface WithConnectionOptions {
    destroyConnection?: boolean;
    type?: "write" | "read";
    useMaster?: boolean;
}

Hierarchy (view full)

Properties

destroyConnection?: boolean

Close the connection when the callback finishes instead of returning it to the pool. This is useful if you want to ensure that the connection is not reused, for example if you ran queries that changed session options.

type?: "write" | "read"

Set which replica to use. Available options are read and write

useMaster?: boolean

Force master or write replica to get connection from