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

Fix use of PreparedStatement in releases #1725

Merged
merged 1 commit into from
Jun 27, 2023

Conversation

benjaminwinger
Copy link
Collaborator

@benjaminwinger benjaminwinger commented Jun 26, 2023

Instead of using forward declarations.
The forward declarations prevent using unique_ptr<PreparedStatement> without extra includes since the type is incomplete, and the necessary header files are unavailable in the single-file header included in the releases.

This is necessary both to compile the rust API against the releases, as well as to use the Connection::prepare function in the C++ API from the releases.

Were forward declarations being used to try and keep BoundStatementResult and LogicalPlan out of the public API, or was it just to try and reduce the number of includes/deal with cyclic includes?

Edit: Explicitly declaring the default destructor fixes the issue without changing the includes.

@benjaminwinger
Copy link
Collaborator Author

I think this could also be fixed by explicitly using the default destructor for PreparedStatement, which might be the better way.

@codecov
Copy link

codecov bot commented Jun 26, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (ddb531f) 91.34% compared to head (5e3ec39) 91.34%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1725   +/-   ##
=======================================
  Coverage   91.34%   91.34%           
=======================================
  Files         749      749           
  Lines       27250    27251    +1     
=======================================
+ Hits        24891    24892    +1     
  Misses       2359     2359           
Impacted Files Coverage Δ
src/include/main/prepared_statement.h 100.00% <ø> (ø)
src/main/prepared_statement.cpp 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Without the explicit desctructor, using unique_ptr<PreparedStatement>
requires extra includes since the types of some of its fields are incomplete, and the
necessary header files are unavailable in the single-file header
included in the releases.
@benjaminwinger benjaminwinger marked this pull request as draft June 26, 2023 21:11
@benjaminwinger benjaminwinger changed the title Include PreparedStatement components directly Fix use of PreparedStatement in releases Jun 26, 2023
@benjaminwinger benjaminwinger marked this pull request as ready for review June 26, 2023 21:25
@benjaminwinger benjaminwinger merged commit 429d37f into master Jun 27, 2023
@benjaminwinger benjaminwinger deleted the prepared-statement-fix branch June 27, 2023 15:34
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

Successfully merging this pull request may close these issues.

2 participants