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

proposing a closeable prepare #38

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

proposing a closeable prepare #38

wants to merge 3 commits into from

Conversation

u007
Copy link

@u007 u007 commented Dec 12, 2019

preparing a closable prepare to allow caller to close the prepared statement to avoid hitting mysql prepare statement limit
example:

Prepared prepared = await adapter.prepare("select * from users where id=?");
Results result = await (await prepared.execute([5])).deStream();
if (result.length < 1) {
  prepared.deallocate();
  return null;
}
// parsing code...
logger.fine("mapped ${result.first}");
// more code here...
prepared.deallocate();

@hoylen
Copy link

hoylen commented Dec 12, 2019

Is this doing what Prepared.deallocate was supported to do (but was never implemented)? That method's limited documentation says it "released the prepared statement", but its implementation in PreparedImpl just throws an UnimplementedError.

If so, either rename your method to deallocate, or keep your name and delete/deprecate the deallocate method. It doesn't help to have two methods whose names make them sound like they do the same thing and there is little documentation on either.

@u007
Copy link
Author

u007 commented Dec 13, 2019

done

@hoylen
Copy link

hoylen commented Dec 13, 2019

Cool.

@tejainece
Copy link
Contributor

Thanks for the PR.

Can we change the implementation so that Connection has deallocatePrepared method that PreparedStatement calls? Instead of passing socket and comm to PreparedStatement?

@u007
Copy link
Author

u007 commented May 24, 2020

hi any more issues?

@4stern
Copy link

4stern commented Dec 22, 2020

its dead...

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.

None yet

4 participants