add disable option for sqlite3_expanded_sql by UnixY2K · Pull Request #399 · SRombauts/SQLiteCpp (original) (raw)
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 andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation2 Commits2 Checks0 Files changed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})
Description
Add an option to disable sqlite3_expanded_sql that disables the internal use of it inside the method Statement::getExpandedSQL so it gives a warning when building SQLiteCpp, at runtime it will give an exception instead
this should fix #213
changes
- CMakeLists.txt: add the
SQLITECPP_DISABLE_EXPANDED_SQLoption along with the defineSQLITECPP_DISABLE_EXPANDED_SQL - meson.build/meson.options: add the same
SQLITECPP_DISABLE_EXPANDED_SQLthat definesSQLITECPP_DISABLE_EXPANDED_SQL - Statement.cpp
- give a warning at compile time if
SQLITECPP_DISABLE_EXPANDED_SQLis not defined when running the version of sqlite < 3.14.0 - give an exception when trying to run
Statement::getExpandedSQLif compiled witouth support forsqlite3_expanded_sql
- give a warning at compile time if
make sqlite3_expanded_sql use optional and give a warning at compile time along with a exception at runtime when used in an application
I think that we could also add an special exception like SQLite::UnsupportedMethodException for any method that does not want to expose the internal implementation of sqlite3 and not make use of the same Exception used for internal SQLite3 Exceptions.
Edit:
I don´t think that this should be on this PR as is a potential refactor/change of how the API throws exceptions, making it easier to differentiate between internal errors and unsupported errors and how other applications handles it, for example app application showing that the support of cyphers or any optional feature is not supported on the system, but that is just a design idea
UnixY2K deleted the optional-sqlite3_expanded_sql branch