sqljocky5
sqljocky5 copied to clipboard
proposing a closeable prepare
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();
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.
done
Cool.
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?
hi any more issues?
its dead...