Skip to content

Conversation

@theStack
Copy link
Contributor

@theStack theStack commented May 16, 2021

This refactoring PR deduplicates repeated SQLite access to PRAGMA settings. Two functions ReadPragmaInteger(...) (reads a single integer value via statement PRAGMA key) and SetPragma(...) (sets a key to specified value via statement PRAGMA key = value) are introduced for this purpose.
This should be more readable and less error-prone, e.g. in case other PRAGMA settings need to be read/set in the future or the error handling has to be adapted.

@theStack theStack force-pushed the 202105-wallet-dedup_sqlite_pragma_stmts branch from 3129f74 to 9938d61 Compare May 17, 2021 15:23
@achow101
Copy link
Member

Code Review ACK 9938d61

@laanwj
Copy link
Member

laanwj commented May 19, 2021

Looks good to me now, code review ACK 9938d61

@laanwj laanwj merged commit 0878128 into bitcoin:master May 19, 2021
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request May 19, 2021
9938d61 wallet: refactor: dedup sqlite PRAGMA assignments (Sebastian Falbesoner)
dca8ef5 wallet: refactor: dedup sqlite PRAGMA integer reads (Sebastian Falbesoner)

Pull request description:

  This refactoring PR deduplicates repeated SQLite access to PRAGMA settings. Two functions `ReadPragmaInteger(...)` (reads a single integer value via statement `PRAGMA key`) and `SetPragma(...)` (sets a key to specified value via statement `PRAGMA key = value`) are introduced for this purpose.
  This should be more readable and less error-prone, e.g. in case other PRAGMA settings need to be read/set in the future or the error handling has to be adapted.

ACKs for top commit:
  achow101:
    Code Review ACK 9938d61
  laanwj:
    Looks good to me now, code review ACK 9938d61

Tree-SHA512: 5332788ead6d8d652e28cb0cef1bf0be2b22d6744f8d02dd9e04a4a68e32e14d4a21f94d9b940c37a0d815be3f0091d956c9f6e269b0a6819b62b40482d3bbd2
@theStack theStack deleted the 202105-wallet-dedup_sqlite_pragma_stmts branch July 31, 2021 20:07
gwillen pushed a commit to ElementsProject/elements that referenced this pull request Jun 1, 2022
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Aug 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants