Skip to content

Connection events #257

@thesmart

Description

@thesmart

Feature request

It would be great to have some way to monitor connection events for reporting purposes and to setup defaults for the connection. For example, in Node I would run:

dbPool.on("connect", (client: PoolClient) => {
  if (ENV.TEST) {
    // Prefer indexes even on small tables. This disables optimizations in PostgreSQL that 
    // prefers scanning small tables, thus changing how EXPLAIN works between test and prod environments. 
    // @see: https://www.postgresql.org/docs/9.4/static/runtime-config-query.html#GUC-ENABLE-SEQSCAN
    client.query(`SET enable_seqscan = OFF;`);
  }
});

I don't see a similar way to do this in the Deno driver.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions