Skip to content

[WIP] MySQL prepared statements - #61

Open
CromFr wants to merge 1 commit into
nwn2dev:mainfrom
CromFr:mysql-prep-stmt
Open

[WIP] MySQL prepared statements#61
CromFr wants to merge 1 commit into
nwn2dev:mainfrom
CromFr:mysql-prep-stmt

Conversation

@CromFr

@CromFr CromFr commented Oct 9, 2022

Copy link
Copy Markdown
Member

Prepared statements provide a safer (no more string escaping required) and more efficient (if identical statements are called frequently) way of running SQL queries.

This PR defines the prepared statements API for SQL plugins, and implements support for the xp_mysql plugin.

TODO:

  • Check that returned strings are not changed on SQL fetch (i.e. check if it's strcpy-ed or if it retains the pointer to the original data)
  • Check results client-side caching (I'm not sure it's enabled)
  • Try improving performance (currently it's only ~10% faster)
  • Implement for xp_sqlite? (should be fairly straightforward)

@CromFr
CromFr force-pushed the mysql-prep-stmt branch from b0ab0d5 to 7b9491d Compare March 9, 2024 23:13
@ihatemundays
ihatemundays changed the base branch from main to 1.3.2_integration February 25, 2026 00:59
@ihatemundays
ihatemundays changed the base branch from 1.3.2_integration to main February 25, 2026 00:59
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.

1 participant