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

Expose prepared statements #27

Draft
wants to merge 16 commits into
base: master
Choose a base branch
from

Conversation

tvandinther
Copy link
Owner

@tvandinther tvandinther commented Aug 31, 2024

Closes #25

This MR implements an interface to expose prepared statements. The internals are also changed to support this new feature.

Public interface changes are present in this MR.

Parameter binding implementation
Bound parameters are held internally in C# and are bound late when the statement is sent for execution. Resetting the statement currently creates a new prepared statement. A change to the bindings code needs to be made to make this both performant and to prevent new bindings from being made.

@tvandinther tvandinther self-assigned this Aug 31, 2024
@tvandinther tvandinther force-pushed the 25-expose-prepared-statements branch from 2fa47f9 to 5401452 Compare August 31, 2024 17:42
@tvandinther
Copy link
Owner Author

Wondering if I revert this to commit 5401452

The current implementation isn't ideal.

However, need to solve the issue in 5401452 where getting the first row of a queried statement after it was reset returns a row with a null pointer which creates a column type array with an enum value of 0 which is invalid. Seems like there is some kind of cursor reset somewhere?

@tvandinther tvandinther force-pushed the 25-expose-prepared-statements branch from fb175d7 to 85e5e7b Compare August 31, 2024 19:52
@tvandinther
Copy link
Owner Author

Waiting for fix to C bindings to be merged upstream tursodatabase/libsql#1713

@tvandinther
Copy link
Owner Author

Upstream fix has been merged. This branch requires an update to the revision of libsql being built to include it.

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.

Expose the prepared statements interface
1 participant