Skip to content

DuckDBConnection.prepareStatement methods could be less strict #82

Open
@ski309

Description

@ski309

The prepareStatement methods in DuckDBConnection here:

public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException {

are currently all stubbed with throw new SQLFeatureNotSupportedException("prepareStatement").

Until they are fully implemented, they could be rewritten so that certain calls may proceed if generated keys are not required. For instance, the call at L296 could be rewritten to:

public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException {
    if (autoGeneratedKeys == NO_GENERATED_KEYS) {
        return prepareStatement(sql);
    } else {
        throw new SQLFeatureNotSupportedException("prepareStatement");
    }
}

These methods as written are currently keeping me from utilizing duckdb with the Jetbrains Exposed API, because the connection wrappers call prepareStatement([sql], NO_GENERATED_KEYS) instead of prepareStatement([sql]).

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