Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .claude/skills/sqlitecpp-build-cmake/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ description: Build SQLiteCpp with CMake. Use for CMake builds, tests, options, o
## Notes
- Tests can use a system `GTest`; otherwise they fall back to the `googletest` submodule.
- If the submodule is needed: `git submodule update --init --recursive`.
- SQLiteCpp requires CMake 3.16 or newer and C++17 or newer.
- SQLiteCpp requires CMake 3.16 or newer, C++17 or newer, and SQLite 3.38.0 or newer.
- `find_package(SQLite3 3.38.0 REQUIRED)` checks discovered system SQLite versions.
Custom SQLite targets are also covered by the source-level compile-time version check.
- MSVC requires VS2017 15.9 / MSVC 19.16 or newer, enforced with a fatal configuration diagnostic.
- `cxx_std_17` requests a standard mode; it does not prove complete C++17 feature support.
Old MSVC toolsets are a special case: CMake can advertise standard meta-features even when the
Expand Down
2 changes: 2 additions & 0 deletions .claude/skills/sqlitecpp-build-meson/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ description: Builds SQLiteCpp with Meson. Use when configuring Meson builds, tes
- `SQLITE_OMIT_LOAD_EXTENSION`: omit load extension.

## Notes
- SQLiteCpp requires SQLite 3.38.0 or newer. Meson checks the sqlite3 dependency version,
and the source-level compile-time check covers custom dependency configurations.
- C++17 is the SQLiteCpp project minimum; Meson defaults to `cpp_std=c++17` and rejects older standards.
- MSVC requires VS2017 15.9 / MSVC 19.16 or newer, matching the CMake minimum and its CI coverage.
- C++20 can be selected explicitly for compatibility testing.
2 changes: 2 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ tests, and CI changes, even when the same task prompts both kinds of work.
- Max 120 characters per line

## Build System Compatibility
- SQLiteCpp 4.x requires SQLite 3.38.0 or newer, whether bundled or provided externally.
A compile-time check rejects older SQLite headers; CMake and Meson also check discovered dependency versions.
- The MSVC minimum is Visual Studio 2017 15.9 (MSVC 19.16 / v141 toolset 14.16).
Keep its explicit build-system diagnostics and dedicated CI coverage aligned. Assert the actual
compiler version and exercise required library facilities so CI cannot silently use a newer toolset.
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- Bump the shared-library ABI version from 0 to 1 for SQLiteCpp 4.0
- Require SQLite 3.38.0 or newer (#596)
- Require C++17 and CMake 3.16 or newer (#580)
- Adopt CMake 4.4 policies and test them (#581)
- Bump the shared-library ABI version from 0 to 1 for SQLiteCpp 4.0
- Use fixed-width integer types in `SQLite::Header`, making field widths consistent across platforms (ABI change) (#582)
- Update googletest to v1.18.0 (#583)
- Improve tests for `Savepoint::rollbackTo()` and scope-exit rollback semantics (#584)
Expand Down
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ elseif (SQLITECPP_FIND_SQLITE)
target_link_libraries(SQLiteCpp PRIVATE ${sqlcipher_LIBRARY})
endif()
else()
find_package (SQLite3 REQUIRED)
find_package (SQLite3 3.38.0 REQUIRED)
message(STATUS "Link to sqlite3 system library ${SQLite3_VERSION}")
target_link_libraries(SQLiteCpp PUBLIC SQLite::SQLite3)
if(SQLite3_VERSION VERSION_LESS "3.19")
Expand Down Expand Up @@ -450,13 +450,15 @@ if (SQLITECPP_RUN_CPPCHECK)
find_program(CPPCHECK_EXECUTABLE NAMES cppcheck)
if (CPPCHECK_EXECUTABLE)
# Add an explicit cppcheck target for the quality workflow.
# Provide the bundled SQLite header so cppcheck can evaluate SQLITE_VERSION_NUMBER.
add_custom_target(SQLiteCpp_cppcheck
COMMAND ${CPPCHECK_EXECUTABLE}
-j 8
--enable=style
--error-exitcode=1
--quiet
--std=c++17
-I${PROJECT_SOURCE_DIR}/sqlite3
${CPPCHECK_ARG_TEMPLATE}
${PROJECT_SOURCE_DIR}/src
)
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ All of the code and documentation in SQLite has been dedicated to the public dom
- to be light and fast

**C++17 baseline:** SQLiteCpp 4.x requires C++17. SQLiteCpp 3.4.x is the final release line supporting C++11; maintenance fixes for the 3.x series remain on the `sqlitecpp-3.4.x` branch.

**SQLite baseline:** SQLiteCpp 4.x requires SQLite 3.38.0 or newer.
- to be thread-safe only as much as SQLite "Multi-thread" mode (see below)
- to have a good unit test coverage
- to use API names sticking with those of the SQLite library
Expand Down Expand Up @@ -87,7 +89,7 @@ and the CMake compatibility workflow also exercises C++20.
- a C++17-capable compiler and standard library
- Visual Studio 2017 15.9 (MSVC 19.16 / v141 toolset 14.16) or newer when using MSVC
- exception support (the class Exception inherits from std::runtime_error)
- the SQLite library (3.8.7 minimum from 2014-10-17), either by linking to it dynamically or statically
- the SQLite library (3.38.0 minimum, released 2022-02-22), either by linking to it dynamically or statically
(install the libsqlite3-dev package under Debian/Ubuntu/Mint Linux),
or by adding its source file in your project code base (source code provided in src/sqlite3 for Windows),
with the `SQLITE_ENABLE_COLUMN_METADATA` macro defined (see http://www.sqlite.org/compile.html#enable_column_metadata).
Expand Down
1 change: 1 addition & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ thread_dep = dependency('threads')
# sqlite3 support
sqlite3_dep = dependency(
'sqlite3',
version: '>=3.38.0',
fallback: ['sqlite3', 'sqlite3_dep']
)

Expand Down
8 changes: 6 additions & 2 deletions src/Database.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
#include <SQLiteCpp/Statement.h>

#include <sqlite3.h>

#if SQLITE_VERSION_NUMBER < 3038000
#error "SQLiteCpp 4.0 requires SQLite 3.38.0 or newer"
#endif
#include <climits>
#include <fstream>
#include <string.h>
Expand Down Expand Up @@ -212,8 +216,8 @@ void Database::loadExtension(const char* apExtensionName, const char *apEntryPoi
// It is recommended that the SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION method be used to enable only this interface.
// The use of the sqlite3_enable_load_extension() interface should be avoided to keep the SQL load_extension()
// disabled and prevent SQL injections from giving attackers access to extension loading capabilities.
// (NOTE: not using nullptr: cannot pass object of non-POD type 'std::__1::nullptr_t' through variadic function)
int ret = sqlite3_db_config(getHandle(), SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION, 1, NULL); // NOTE: not using nullptr
// sqlite3_db_config is variadic; pass a typed null pointer for its optional int* output.
int ret = sqlite3_db_config(getHandle(), SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION, 1, static_cast<int*>(nullptr));
#else
int ret = sqlite3_enable_load_extension(getHandle(), 1);
#endif
Expand Down
Loading