Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DuckDBConnection.prepareStatement methods could be less strict #82

Open
ski309 opened this issue Sep 13, 2024 · 0 comments
Open

DuckDBConnection.prepareStatement methods could be less strict #82

ski309 opened this issue Sep 13, 2024 · 0 comments

Comments

@ski309
Copy link

ski309 commented Sep 13, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant