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

[chore] SQL Prepared Statements #1349

Closed
5 tasks done
zach2good opened this issue Mar 1, 2022 · 4 comments
Closed
5 tasks done

[chore] SQL Prepared Statements #1349

zach2good opened this issue Mar 1, 2022 · 4 comments
Assignees

Comments

@zach2good
Copy link
Contributor

  • I have paid attention to this example and will edit again if need be to not break the formatting, or I will be ignored
  • I have searched existing issues to see if the issue has already been opened
  • I have checked the commit log to see if the issue has been resolved since my server was last updated
  • I have read the Contributing Guide
  • I have specified what branch this happens on branch: EDITME

Additional Information (Steps to reproduce/Expected behavior) :

They're not very hard to use, we could be using them:
https://gist.github.com/henryscala/f7a18fbb36fdd17351046fdce7c64c01

  • Register on startup
  • Bind and use
  • They release themselves on connection death/shutdown

Will need to measure to see if it makes much/any difference

@zach2good zach2good self-assigned this Mar 1, 2022
@zach2good
Copy link
Contributor Author

I snuck a partial/unworking implmentation in during my last SQL refactor. Still need to make some utilities for easy binding of params and results:
https://github.com/LandSandBoat/server/blob/base/src/common/sql_prepared_stmt.cpp

I feel like if it's extremely fiddly and hard to set these up, then nobody will ever consider using them. So I'll make sure there's sufficient tooling.

@zach2good
Copy link
Contributor Author

@zach2good
Copy link
Contributor Author

How I'm imagining they're used:

auto res = sql-> GetPreparedStatement("GET_CHAR_VAR")(params...);

@zach2good
Copy link
Contributor Author

It's in, as part of: #4601

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