Skip to content

DuckDBConnection.prepareStatement methods could be less strict #82

@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]).

Activity

linked a pull request that will close this issue on Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @ski309

      Issue actions

        DuckDBConnection.prepareStatement methods could be less strict · Issue #82 · duckdb/duckdb-java