Skip to content

Execute method that supports SQL queries with parameters #27

Open
@hoylen

Description

@hoylen

There needs to be an execute method that can take a SQL statement and a list of parameters: Future<StreamedResults> execute(String sql, Iterable values). Sometimes (often?) you want to run a query which has parameters (e.g. from user input), but don't want to create a prepared statement.

The old sqljocky5 v1.x had such a method.

In the Transaction class of sqljocky5 v2.2.1, there is an execute method that does not accept parameters (only a string) or the prepared method which does (which takes a string and an Iterable). But if you keep using the prepared method, eventually you reach the max_prepared_stmt_count limit in MySQL (and no more queries can be run). The prepared method shouldn't exist, since it creates prepared statements on the database that can't be deallocated (other than by closing the connection).

(The execute-with-parameters method is probably also needed for the Connection, but I only need it for a Transaction.)

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