teamhackback / hb-ddb

Vibe.d Async native D Postgres client
https://teamhackback.github.io/hb-ddb/docs/ddb/pg.html
1 stars 1 forks source link

PGConnection: executeQuery without PGCommand #14

Closed wilzbach closed 7 years ago

wilzbach commented 7 years ago

Currently executeQuery (or executeRow, executeNonQuery or executeScalar) create a temporaryPGCommand`:

PGResultSet!Specs executeQuery(Specs...)(string query)
{
    scope cmd = FreeListRef!PGCommand(this, query);
    return cmd.executeQuery!Specs();
}

which itself calls:

PGResultSet!Specs executeQuery(Specs...)()
{
    checkPrepared(true);
    checkBound();
    return conn.executeQuery!Specs(preparedName, _fields);
}

Maybe it might make sense to avoid creating a prepared statement at all?

wilzbach commented 7 years ago

resolved with: f36e3903047c28176cec57ce4bc5eb3020f6bdba