Skip to content

Question: Using prepared query with Pool #295

Description

@WillCauldron

tl;dr is it possible to create a prepared statement and submit to the pool, rather than manually opening a connection and submitting the query there?

First, having previously worked on a project with a much older version of this library, I'm in adoration of the new features available in v4+. Particularly the Pool and Prepared Statements. So many thanks for these excellent additions.

I'd like to make use of the prepared statements feature, to better optimise some repeated calls to the database. However, I'm struggling to work out how you would combine this with the Pool logic. I can't see a route by which you could create a prepared statement without first needing a connection, nor a way of requesting a connection from the pool directly.

Is there an existing route for combining these two features?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions