SQLiteCpp Coding Standards
Non-negotiables
- RAII only: acquire in constructors, release in destructors.
- Never throw in destructors; use
SQLITECPP_ASSERT()instead. - C++11 only in core library (C++14 only in
VariadicBind.handExecuteMany.h). - Public API headers must not include
sqlite3.h. - Public API must use
SQLITECPP_APIfromSQLiteCppExport.h. - One
Database/Statement/Columnper thread.
Error handling
- Throw
SQLite::Exceptionfor errors in throwing APIs. - Use
tryExec(),tryExecuteStep(),tryReset()for error codes.
Documentation and style
- Doxygen required for public API (
@brief,@param,@return,@throw). - ASCII only, 4 spaces, Allman braces, max 120 chars, LF line endings, final newline.
- LF line endings are enforced repo-wide by
.gitattributes(* text=auto eol=lf), matching.editorconfig(end_of_line = lf); never commit CRLF. Rungit add --renormalize .if a file drifts. - Use
#pragma oncein headers.
Naming conventions
- Types: PascalCase (
Database,Statement). - Functions/vars: camelCase (
executeStep(),getColumn()). - Members:
mprefix (mDatabase). - Args:
aprefix (aDatabase). - Booleans:
b/mbprefix (bExists,mbDone). - Pointers:
p/mpprefix (pValue,mpSQLite).