diff --git a/.travis.yml b/.travis.yml index 59535bcf..8edea08e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,4 @@ -# Copyright (c) 2012-2022 Sebastien Rombauts (sebastien.rombauts@gmail.com) +# Copyright (c) 2012-2023 Sebastien Rombauts (sebastien.rombauts@gmail.com) language: cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index e3ee115d..24235759 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ # Main CMake file for compiling the library itself, examples and tests. # -# Copyright (c) 2012-2022 Sebastien Rombauts (sebastien.rombauts@gmail.com) +# Copyright (c) 2012-2023 Sebastien Rombauts (sebastien.rombauts@gmail.com) # # Distributed under the MIT License (MIT) (See accompanying file LICENSE.txt # or copy at http://opensource.org/licenses/MIT) diff --git a/LICENSE.txt b/LICENSE.txt index c7dbfef3..c060d7f5 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2012-2022 Sebastien Rombauts (sebastien.rombauts@gmail.com) +Copyright (c) 2012-2023 Sebastien Rombauts (sebastien.rombauts@gmail.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 8c5a6fdd..f31c6d00 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ with a few intuitive and well documented C++ classes. ### License: -Copyright (c) 2012-2022 Sébastien Rombauts (sebastien.rombauts@gmail.com) +Copyright (c) 2012-2023 Sébastien Rombauts (sebastien.rombauts@gmail.com) Distributed under the MIT License (MIT) (See accompanying file LICENSE.txt diff --git a/appveyor.yml b/appveyor.yml index 07829545..7175218f 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,47 +1,47 @@ -# Copyright (c) 2012-2022 Sebastien Rombauts (sebastien.rombauts@gmail.com) - -# build format -version: "{build}" - -# scripts that run after cloning repository -install: - - git submodule update --init --recursive - +# Copyright (c) 2012-2023 Sebastien Rombauts (sebastien.rombauts@gmail.com) + +# build format +version: "{build}" + +# scripts that run after cloning repository +install: + - git submodule update --init --recursive + image: -# Reduce the number of images to test on AppVeyor, to speed up the build - - Visual Studio 2022 -# - Visual Studio 2019 -# - Visual Studio 2017 - - Visual Studio 2015 - -# configurations to add to build matrix -# TODO: MinGW Makefiles and MSYS Makefiles -configuration: - - Debug - - Release - -environment: - matrix: - - arch: Win32 - - arch: x64 - -init: - - echo %APPVEYOR_BUILD_WORKER_IMAGE% - %configuration% - %arch% - - if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2017" (set vs=Visual Studio 15 2017) - - if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2015" (set vs=Visual Studio 14 2015) - - if "%arch%"=="x64" (set generator="%vs% Win64") else (set generator="%vs%") - # CMake uses a different grammar for Visual Studio 2019, with -A to specify architecture: - - if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2019" (set generator="Visual Studio 16 2019" -A %arch%) - - if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2022" (set generator="Visual Studio 17 2022" -A %arch%) - - echo %generator% - -# scripts to run before build -before_build: - - mkdir build - - cd build - - cmake -DCMAKE_VERBOSE_MAKEFILE=ON -DSQLITECPP_BUILD_EXAMPLES=ON -DSQLITECPP_BUILD_TESTS=ON -DSQLITECPP_RUN_CPPCHECK=OFF .. -G %generator% - -# build examples, and run tests (ie make & make test) -build_script: - - cmake --build . --config %configuration% - - ctest --output-on-failure +# Reduce the number of images to test on AppVeyor, to speed up the build + - Visual Studio 2022 +# - Visual Studio 2019 +# - Visual Studio 2017 + - Visual Studio 2015 + +# configurations to add to build matrix +# TODO: MinGW Makefiles and MSYS Makefiles +configuration: + - Debug + - Release + +environment: + matrix: + - arch: Win32 + - arch: x64 + +init: + - echo %APPVEYOR_BUILD_WORKER_IMAGE% - %configuration% - %arch% + - if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2017" (set vs=Visual Studio 15 2017) + - if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2015" (set vs=Visual Studio 14 2015) + - if "%arch%"=="x64" (set generator="%vs% Win64") else (set generator="%vs%") + # CMake uses a different grammar for Visual Studio 2019, with -A to specify architecture: + - if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2019" (set generator="Visual Studio 16 2019" -A %arch%) + - if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2022" (set generator="Visual Studio 17 2022" -A %arch%) + - echo %generator% + +# scripts to run before build +before_build: + - mkdir build + - cd build + - cmake -DCMAKE_VERBOSE_MAKEFILE=ON -DSQLITECPP_BUILD_EXAMPLES=ON -DSQLITECPP_BUILD_TESTS=ON -DSQLITECPP_RUN_CPPCHECK=OFF .. -G %generator% + +# build examples, and run tests (ie make & make test) +build_script: + - cmake --build . --config %configuration% + - ctest --output-on-failure diff --git a/build.bat b/build.bat index 02bf5cbf..b8295963 100644 --- a/build.bat +++ b/build.bat @@ -1,4 +1,4 @@ -@REM Copyright (c) 2012-2022 Sebastien Rombauts (sebastien.rombauts@gmail.com) +@REM Copyright (c) 2012-2023 Sebastien Rombauts (sebastien.rombauts@gmail.com) @REM @REM Distributed under the MIT License (MIT) (See accompanying file LICENSE.txt @REM or copy at http://opensource.org/licenses/MIT) diff --git a/build.sh b/build.sh index f7fb6123..df4cd1b8 100755 --- a/build.sh +++ b/build.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (c) 2012-2020 Sébastien Rombauts (sebastien.rombauts@gmail.com) +# Copyright (c) 2012-2023 Sébastien Rombauts (sebastien.rombauts@gmail.com) # # Distributed under the MIT License (MIT) (See accompanying file LICENSE.txt # or copy at http://opensource.org/licenses/MIT) diff --git a/docs/README.md b/docs/README.md index b8943c1c..9bf9f0b3 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,359 +1,359 @@ -SQLiteC++ ---------- - -[![release](https://img.shields.io/github/release/SRombauts/SQLiteCpp.svg)](https://github.com/SRombauts/SQLiteCpp/releases) -[![license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/SRombauts/SQLiteCpp/blob/master/LICENSE.txt) -[![Travis CI Linux Build Status](https://travis-ci.org/SRombauts/SQLiteCpp.svg?branch=master)](https://travis-ci.org/SRombauts/SQLiteCpp "Travis CI Linux Build Status") -[![AppVeyor Windows Build status](https://ci.appveyor.com/api/projects/status/github/SRombauts/SQLiteCpp?svg=true)](https://ci.appveyor.com/project/SbastienRombauts/SQLiteCpp "AppVeyor Windows Build status") -[![GitHub Actions Build status](https://github.com/SRombauts/SQLiteCpp/workflows/build/badge.svg)](https://github.com/SRombauts/SQLiteCpp/actions "GitHhub Actions Build status") -[![Coveralls](https://img.shields.io/coveralls/SRombauts/SQLiteCpp.svg)](https://coveralls.io/github/SRombauts/SQLiteCpp "Coveralls test coverage") -[![Coverity](https://img.shields.io/coverity/scan/14508.svg)](https://scan.coverity.com/projects/srombauts-sqlitecpp "Coverity Scan Build Status") -[![Join the chat at https://gitter.im/SRombauts/SQLiteCpp](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/SRombauts/SQLiteCpp?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) - -SQLiteC++ (SQLiteCpp) is a lean and easy to use C++ SQLite3 wrapper. - - - - -## About SQLiteC++: - -SQLiteC++ offers an encapsulation around the native C APIs of SQLite, -with a few intuitive and well documented C++ classes. - -### License: - -Copyright (c) 2012-2022 Sébastien Rombauts (sebastien.rombauts@gmail.com) - - -Distributed under the MIT License (MIT) (See accompanying file LICENSE.txt -or copy at http://opensource.org/licenses/MIT) - -#### Note on redistribution of SQLite source files - -As stated by the MIT License, you are welcome to reuse, modify, and redistribute the SQLiteCpp source code -the way you want it to, be it a git submodule, a subdirectory, or a selection of some source files. - -I would love a mention in your README, a web link to the SQLite repository, and a mention of the author, -but none of those are mandatory. - -### About SQLite underlying library: - -SQLite is a library that implements a serverless transactional SQL database engine. -It is the most widely deployed SQL database engine in the world. -All of the code and documentation in SQLite has been dedicated to the public domain by the authors. -[http://www.sqlite.org/about.html](http://www.sqlite.org/about.html) - -### The goals of SQLiteC++ are: - -- to offer the best of the existing simple C++ SQLite wrappers -- to be elegantly written with good C++11 design, STL, exceptions and RAII idiom -- to keep dependencies to a minimum (C++11 STL and SQLite3) -- to be portable -- to be light and fast -- 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 -- to be well documented with Doxygen tags, and with some good examples -- to be well maintained -- to use a permissive MIT license, similar to BSD or Boost, for proprietary/commercial usage - -It is designed using the Resource Acquisition Is Initialization (RAII) idiom -(see [http://en.wikipedia.org/wiki/Resource_Acquisition_Is_Initialization](http://en.wikipedia.org/wiki/Resource_Acquisition_Is_Initialization)), -and throwing exceptions in case of SQLite errors (except in destructors, -where assert() are used instead). -Each SQLiteC++ object must be constructed with a valid SQLite database connection, -and then is always valid until destroyed. - -### Supported platforms: - -Now requires a C++11 compiler. Use branch [sqlitecpp-2.x](https://github.com/SRombauts/SQLiteCpp/tree/sqlitecpp-2.x) for latest pre-C++11 developments. - -Developments and tests are done under the following OSs: -- Ubuntu 14.04, 16.04 and 18.04 (Travis CI and Github Actions) -- Windows 10, and Windows Server 2012 R2, Windows Server 2016, Windows Server 2022 (AppVeyor and Github Actions) -- MacOS 10.11 and 11.7 (Travis CI and Github Actions) -- Valgrind memcheck tool - -And the following IDEs/Compilers -- GCC 4.8.4, 5.3.0, 7.1.1 and latest eg 9.4 (C++11, C++14, C++17) -- Clang 5 and 7 (Travis CI) -- AppleClang 8, 9 and 13 (Travis CI and Github Actions) -- Xcode 8 & 9 (Travis CI) -- Visual Studio Community/Entreprise 2022, 2019, 2017, and 2015 (AppVeyor and Github Actions) - -### Dependencies - -- a modern C++11 STL implementation with GCC, Clang, or Visual Studio 2015 -- exception support (the class Exception inherits from std::runtime_error) -- the SQLite library (3.7.15 minimum from 2012-12-12) 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). - -## Getting started -### Installation - -To use this wrapper, you need to add the SQLiteC++ source files from the src/ directory -in your project code base, and compile/link against the sqlite library. - -The easiest way to do this is to add the wrapper as a library. -The "CMakeLists.txt" file defining the static library is provided in the root directory, -so you simply have to add_subdirectory(SQLiteCpp) to you main CMakeLists.txt -and link to the "SQLiteCpp" wrapper library. - -Example for Linux: -```cmake -add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/thirdparty/SQLiteCpp) - -add_executable(main src/main.cpp) -target_link_libraries(main - SQLiteCpp - sqlite3 - pthread - dl - ) -``` -Thus this SQLiteCpp repository can be directly used as a Git submodule. -See the [SQLiteCpp_Example](https://github.com/SRombauts/SQLiteCpp_Example) side repository for a standalone "from scratch" example. - -Under Debian/Ubuntu/Mint Linux, you can install the libsqlite3-dev package if you don't want to use the embedded sqlite3 library. - -### Building example and unit-tests: - -Use git to clone the repository. Then init and update submodule "googletest". - -```Shell -git clone https://github.com/SRombauts/SQLiteCpp.git -cd SQLiteCpp -git submodule init -git submodule update -``` - -### Installing SQLiteCpp (vcpkg) - -Alternatively, you can build and install SQLiteCpp using [vcpkg](https://github.com/Microsoft/vcpkg/) dependency manager: - -```bash or powershell -git clone https://github.com/Microsoft/vcpkg.git -cd vcpkg -./bootstrap-vcpkg.sh -./vcpkg integrate install -./vcpkg install sqlitecpp -``` - -The SQLiteCpp port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please [create an issue or pull request](https://github.com/Microsoft/vcpkg) on the vcpkg repository. - - -#### Using SQLiteCpp on a system-wide installation - -If you installed this package to your system, a `SQLiteCppConfig.cmake` file will be generated & installed to your system. -This file lets you link against the SQLiteCpp library for use in your Cmake project. - -Here's an example of using this in your CMakeLists.txt -```cmake -# You can optionally define a minimum version in this call -find_package(SQLiteCpp REQUIRED) -# For this example, lets say you created an target with add_executable (or add_library) called "my_target" -# You can optionally declare PUBLIC or PRIVATE linkage here, depending on your needs. -target_link_libraries(my_target PRIVATE SQLiteCpp) -``` - -#### CMake and tests -A CMake configuration file is also provided for multi-platform support and testing. - -Typical generic build for MS Visual Studio under Windows (from [build.bat](build.bat)): - -```Batchfile -mkdir build -cd build - -cmake .. # cmake .. -G "Visual Studio 16 2019" # for Visual Studio 2019 -@REM Generate a Visual Studio solution for latest version found -cmake -DSQLITECPP_BUILD_EXAMPLES=ON -DSQLITECPP_BUILD_TESTS=ON .. - -@REM Build default configuration (ie 'Debug') -cmake --build . - -@REM Build and run tests -ctest --output-on-failure -``` - -Generating the Linux Makefile, building in Debug and executing the tests (from [build.sh](build.sh)): - -```Shell -mkdir Debug -cd Debug - -# Generate a Makefile for GCC (or Clang, depanding on CC/CXX envvar) -cmake -DSQLITECPP_BUILD_EXAMPLES=ON -DSQLITECPP_BUILD_TESTS=ON .. - -# Build (ie 'make') -cmake --build . - -# Build and run unit-tests (ie 'make test') -ctest --output-on-failure -``` - -#### CMake options - - * For more options on customizing the build, see the [CMakeLists.txt](https://github.com/SRombauts/SQLiteCpp/blob/master/CMakeLists.txt) file. - -#### Troubleshooting - -Under Linux, if you get multiple linker errors like "undefined reference to sqlite3_xxx", -it's that you lack the "sqlite3" library: install the libsqlite3-dev package. - -If you get a single linker error "Column.cpp: undefined reference to sqlite3_column_origin_name", -it's that your "sqlite3" library was not compiled with -the `SQLITE_ENABLE_COLUMN_METADATA` macro defined (see [http://www.sqlite.org/compile.html#enable_column_metadata](http://www.sqlite.org/compile.html#enable_column_metadata)). -You can: - - either recompile the sqlite3 library provided by your distribution yourself (seek help online) - - or turn off the `option(SQLITE_ENABLE_COLUMN_METADATA "Enable Column::getColumnOriginName(). Require support from sqlite3 library." ON)` in [CMakeFiles.txt](CMakeFiles.txt) (or other build system scripts) - - or turn on the `option(SQLITECPP_INTERNAL_SQLITE "Add the internal SQLite3 source to the project." ON)` in [CMakeFiles.txt](CMakeFiles.txt) - -### Continuous Integration - -This project is continuously tested under Ubuntu Linux with the gcc and clang compilers -using the Travis CI community service with the above CMake building and testing procedure. -It is also tested in the same way under Windows Server 2012 R2 with Visual Studio 2013 compiler -using the AppVeyor continuous integration service. - -Detailed results can be seen online: - - [https://travis-ci.org/SRombauts/SQLiteCpp](https://travis-ci.org/SRombauts/SQLiteCpp) - - [https://ci.appveyor.com/project/SbastienRombauts/SQLiteCpp](https://ci.appveyor.com/project/SbastienRombauts/SQLiteCpp) - -### Thread-safety - -SQLite supports three modes of thread safety, as describe in "SQLite And Multiple Threads": -see [http://www.sqlite.org/threadsafe.html](http://www.sqlite.org/threadsafe.html) - -This SQLiteC++ wrapper does no add any locks (no mutexes) nor any other thread-safety mechanism -above the SQLite library itself, by design, for lightness and speed. - -Thus, SQLiteC++ naturally supports the "Multi Thread" mode of SQLite: -"In this mode, SQLite can be safely used by multiple threads -provided that no single database connection is used simultaneously in two or more threads." - -But SQLiteC++ does not support the fully thread-safe "Serialized" mode of SQLite, -because of the way it shares the underlying SQLite precompiled statement -in a custom shared pointer (See the inner class "Statement::Ptr"). - -### Valgrind memcheck - -Run valgrind to search for memory leaks in your application, the SQLiteCpp wrapper, or the sqlite3 library. -Execute the following command under Unix like OS (Linux, MacOS or WSL2/Ubuntu under Windows Subsystem for Linux): - -```Shell -valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes --verbose build/SQLiteCpp_example1 -``` - -or uncoment the line at the end of [build.sh](build.sh) - -## Examples -### The first sample demonstrates how to query a database and get results: - -```C++ -try -{ - // Open a database file - SQLite::Database db("example.db3"); - - // Compile a SQL query, containing one parameter (index 1) - SQLite::Statement query(db, "SELECT * FROM test WHERE size > ?"); - - // Bind the integer value 6 to the first parameter of the SQL query - query.bind(1, 6); - - // Loop to execute the query step by step, to get rows of result - while (query.executeStep()) - { - // Demonstrate how to get some typed column value - int id = query.getColumn(0); - const char* value = query.getColumn(1); - int size = query.getColumn(2); - - std::cout << "row: " << id << ", " << value << ", " << size << std::endl; - } -} -catch (std::exception& e) -{ - std::cout << "exception: " << e.what() << std::endl; -} -``` - -### The second sample shows how to manage a transaction: - -```C++ -try -{ - SQLite::Database db("transaction.db3", SQLite::OPEN_READWRITE|SQLite::OPEN_CREATE); - - db.exec("DROP TABLE IF EXISTS test"); - - // Begin transaction - SQLite::Transaction transaction(db); - - db.exec("CREATE TABLE test (id INTEGER PRIMARY KEY, value TEXT)"); - - int nb = db.exec("INSERT INTO test VALUES (NULL, \"test\")"); - std::cout << "INSERT INTO test VALUES (NULL, \"test\")\", returned " << nb << std::endl; - - // Commit transaction - transaction.commit(); -} -catch (std::exception& e) -{ - std::cout << "exception: " << e.what() << std::endl; -} -``` - -### How to handle assertion in SQLiteC++: -Exceptions shall not be used in destructors, so SQLiteC++ uses SQLITECPP_ASSERT() to check for errors in destructors. -If you don't want assert() to be called, you have to enable and define an assert handler as shown below, -and by setting the flag SQLITECPP_ENABLE_ASSERT_HANDLER when compiling the lib. - -```C++ -#ifdef SQLITECPP_ENABLE_ASSERT_HANDLER -namespace SQLite -{ -/// definition of the assertion handler enabled when SQLITECPP_ENABLE_ASSERT_HANDLER is defined in the project (CMakeList.txt) -void assertion_failed(const char* apFile, const long apLine, const char* apFunc, const char* apExpr, const char* apMsg) -{ - // Print a message to the standard error output stream, and abort the program. - std::cerr << apFile << ":" << apLine << ":" << " error: assertion failed (" << apExpr << ") in " << apFunc << "() with message \"" << apMsg << "\"\n"; - std::abort(); -} -} -#endif -``` - -## How to contribute -### GitHub website -The most efficient way to help and contribute to this wrapper project is to -use the tools provided by GitHub: -- please fill bug reports and feature requests here: [https://github.com/SRombauts/SQLiteCpp/issues](https://github.com/SRombauts/SQLiteCpp/issues) -- fork the repository, make some small changes and submit them with pull-request - -### Contact -You can also email me directly, I will try to answer questions and requests whenever I get the time for it. - -### Coding Style Guidelines -The source code use the CamelCase naming style variant where: -- type names (class, struct, typedef, enums...) begin with a capital letter -- files (.cpp/.h) are named like the class they contain -- function and variable names begin with a lower case letter -- member variables begin with a 'm', function arguments begin with a 'a', booleans with a 'b', pointers with a 'p' -- each file, class, method and member variable is documented using Doxygen tags -- braces on their own line -See also [http://www.appinf.com/download/CppCodingStyleGuide.pdf](http://www.appinf.com/download/CppCodingStyleGuide.pdf) for good guidelines - -## See also - Some other simple C++ SQLite wrappers: - -See bellow a short comparison of other wrappers done at the time of writing: - - [sqdbcpp](http://code.google.com/p/sqdbcpp/): RAII design, simple, no dependencies, UTF-8/UTF-16, new BSD license - - [sqlite3cc](http://ed.am/dev/sqlite3cc): uses boost, modern design, LPGPL - - [sqlite3pp](https://github.com/iwongu/sqlite3pp): modern design inspired by boost, MIT License - - [SQLite++](http://sqlitepp.berlios.de/): uses boost build system, Boost License 1.0 - - [CppSQLite](http://www.codeproject.com/Articles/6343/CppSQLite-C-Wrapper-for-SQLite/): famous Code Project but old design, BSD License - - [easySQLite](http://code.google.com/p/easysqlite/): manages table as structured objects, complex - - [sqlite_modern_cpp](https://github.com/keramer/sqlite_modern_cpp): modern C++11, all in one file, MIT license - - [sqlite_orm](https://github.com/fnc12/sqlite_orm): modern C++14, header only all in one file, no raw string queries, BSD-3 license +SQLiteC++ +--------- + +[![release](https://img.shields.io/github/release/SRombauts/SQLiteCpp.svg)](https://github.com/SRombauts/SQLiteCpp/releases) +[![license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/SRombauts/SQLiteCpp/blob/master/LICENSE.txt) +[![Travis CI Linux Build Status](https://travis-ci.org/SRombauts/SQLiteCpp.svg?branch=master)](https://travis-ci.org/SRombauts/SQLiteCpp "Travis CI Linux Build Status") +[![AppVeyor Windows Build status](https://ci.appveyor.com/api/projects/status/github/SRombauts/SQLiteCpp?svg=true)](https://ci.appveyor.com/project/SbastienRombauts/SQLiteCpp "AppVeyor Windows Build status") +[![GitHub Actions Build status](https://github.com/SRombauts/SQLiteCpp/workflows/build/badge.svg)](https://github.com/SRombauts/SQLiteCpp/actions "GitHhub Actions Build status") +[![Coveralls](https://img.shields.io/coveralls/SRombauts/SQLiteCpp.svg)](https://coveralls.io/github/SRombauts/SQLiteCpp "Coveralls test coverage") +[![Coverity](https://img.shields.io/coverity/scan/14508.svg)](https://scan.coverity.com/projects/srombauts-sqlitecpp "Coverity Scan Build Status") +[![Join the chat at https://gitter.im/SRombauts/SQLiteCpp](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/SRombauts/SQLiteCpp?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) + +SQLiteC++ (SQLiteCpp) is a lean and easy to use C++ SQLite3 wrapper. + + + + +## About SQLiteC++: + +SQLiteC++ offers an encapsulation around the native C APIs of SQLite, +with a few intuitive and well documented C++ classes. + +### License: + +Copyright (c) 2012-2023 Sébastien Rombauts (sebastien.rombauts@gmail.com) + + +Distributed under the MIT License (MIT) (See accompanying file LICENSE.txt +or copy at http://opensource.org/licenses/MIT) + +#### Note on redistribution of SQLite source files + +As stated by the MIT License, you are welcome to reuse, modify, and redistribute the SQLiteCpp source code +the way you want it to, be it a git submodule, a subdirectory, or a selection of some source files. + +I would love a mention in your README, a web link to the SQLite repository, and a mention of the author, +but none of those are mandatory. + +### About SQLite underlying library: + +SQLite is a library that implements a serverless transactional SQL database engine. +It is the most widely deployed SQL database engine in the world. +All of the code and documentation in SQLite has been dedicated to the public domain by the authors. +[http://www.sqlite.org/about.html](http://www.sqlite.org/about.html) + +### The goals of SQLiteC++ are: + +- to offer the best of the existing simple C++ SQLite wrappers +- to be elegantly written with good C++11 design, STL, exceptions and RAII idiom +- to keep dependencies to a minimum (C++11 STL and SQLite3) +- to be portable +- to be light and fast +- 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 +- to be well documented with Doxygen tags, and with some good examples +- to be well maintained +- to use a permissive MIT license, similar to BSD or Boost, for proprietary/commercial usage + +It is designed using the Resource Acquisition Is Initialization (RAII) idiom +(see [http://en.wikipedia.org/wiki/Resource_Acquisition_Is_Initialization](http://en.wikipedia.org/wiki/Resource_Acquisition_Is_Initialization)), +and throwing exceptions in case of SQLite errors (except in destructors, +where assert() are used instead). +Each SQLiteC++ object must be constructed with a valid SQLite database connection, +and then is always valid until destroyed. + +### Supported platforms: + +Now requires a C++11 compiler. Use branch [sqlitecpp-2.x](https://github.com/SRombauts/SQLiteCpp/tree/sqlitecpp-2.x) for latest pre-C++11 developments. + +Developments and tests are done under the following OSs: +- Ubuntu 14.04, 16.04 and 18.04 (Travis CI and Github Actions) +- Windows 10, and Windows Server 2012 R2, Windows Server 2016, Windows Server 2022 (AppVeyor and Github Actions) +- MacOS 10.11 and 11.7 (Travis CI and Github Actions) +- Valgrind memcheck tool + +And the following IDEs/Compilers +- GCC 4.8.4, 5.3.0, 7.1.1 and latest eg 9.4 (C++11, C++14, C++17) +- Clang 5 and 7 (Travis CI) +- AppleClang 8, 9 and 13 (Travis CI and Github Actions) +- Xcode 8 & 9 (Travis CI) +- Visual Studio Community/Entreprise 2022, 2019, 2017, and 2015 (AppVeyor and Github Actions) + +### Dependencies + +- a modern C++11 STL implementation with GCC, Clang, or Visual Studio 2015 +- exception support (the class Exception inherits from std::runtime_error) +- the SQLite library (3.7.15 minimum from 2012-12-12) 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). + +## Getting started +### Installation + +To use this wrapper, you need to add the SQLiteC++ source files from the src/ directory +in your project code base, and compile/link against the sqlite library. + +The easiest way to do this is to add the wrapper as a library. +The "CMakeLists.txt" file defining the static library is provided in the root directory, +so you simply have to add_subdirectory(SQLiteCpp) to you main CMakeLists.txt +and link to the "SQLiteCpp" wrapper library. + +Example for Linux: +```cmake +add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/thirdparty/SQLiteCpp) + +add_executable(main src/main.cpp) +target_link_libraries(main + SQLiteCpp + sqlite3 + pthread + dl + ) +``` +Thus this SQLiteCpp repository can be directly used as a Git submodule. +See the [SQLiteCpp_Example](https://github.com/SRombauts/SQLiteCpp_Example) side repository for a standalone "from scratch" example. + +Under Debian/Ubuntu/Mint Linux, you can install the libsqlite3-dev package if you don't want to use the embedded sqlite3 library. + +### Building example and unit-tests: + +Use git to clone the repository. Then init and update submodule "googletest". + +```Shell +git clone https://github.com/SRombauts/SQLiteCpp.git +cd SQLiteCpp +git submodule init +git submodule update +``` + +### Installing SQLiteCpp (vcpkg) + +Alternatively, you can build and install SQLiteCpp using [vcpkg](https://github.com/Microsoft/vcpkg/) dependency manager: + +```bash or powershell +git clone https://github.com/Microsoft/vcpkg.git +cd vcpkg +./bootstrap-vcpkg.sh +./vcpkg integrate install +./vcpkg install sqlitecpp +``` + +The SQLiteCpp port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please [create an issue or pull request](https://github.com/Microsoft/vcpkg) on the vcpkg repository. + + +#### Using SQLiteCpp on a system-wide installation + +If you installed this package to your system, a `SQLiteCppConfig.cmake` file will be generated & installed to your system. +This file lets you link against the SQLiteCpp library for use in your Cmake project. + +Here's an example of using this in your CMakeLists.txt +```cmake +# You can optionally define a minimum version in this call +find_package(SQLiteCpp REQUIRED) +# For this example, lets say you created an target with add_executable (or add_library) called "my_target" +# You can optionally declare PUBLIC or PRIVATE linkage here, depending on your needs. +target_link_libraries(my_target PRIVATE SQLiteCpp) +``` + +#### CMake and tests +A CMake configuration file is also provided for multi-platform support and testing. + +Typical generic build for MS Visual Studio under Windows (from [build.bat](build.bat)): + +```Batchfile +mkdir build +cd build + +cmake .. # cmake .. -G "Visual Studio 16 2019" # for Visual Studio 2019 +@REM Generate a Visual Studio solution for latest version found +cmake -DSQLITECPP_BUILD_EXAMPLES=ON -DSQLITECPP_BUILD_TESTS=ON .. + +@REM Build default configuration (ie 'Debug') +cmake --build . + +@REM Build and run tests +ctest --output-on-failure +``` + +Generating the Linux Makefile, building in Debug and executing the tests (from [build.sh](build.sh)): + +```Shell +mkdir Debug +cd Debug + +# Generate a Makefile for GCC (or Clang, depanding on CC/CXX envvar) +cmake -DSQLITECPP_BUILD_EXAMPLES=ON -DSQLITECPP_BUILD_TESTS=ON .. + +# Build (ie 'make') +cmake --build . + +# Build and run unit-tests (ie 'make test') +ctest --output-on-failure +``` + +#### CMake options + + * For more options on customizing the build, see the [CMakeLists.txt](https://github.com/SRombauts/SQLiteCpp/blob/master/CMakeLists.txt) file. + +#### Troubleshooting + +Under Linux, if you get multiple linker errors like "undefined reference to sqlite3_xxx", +it's that you lack the "sqlite3" library: install the libsqlite3-dev package. + +If you get a single linker error "Column.cpp: undefined reference to sqlite3_column_origin_name", +it's that your "sqlite3" library was not compiled with +the `SQLITE_ENABLE_COLUMN_METADATA` macro defined (see [http://www.sqlite.org/compile.html#enable_column_metadata](http://www.sqlite.org/compile.html#enable_column_metadata)). +You can: + - either recompile the sqlite3 library provided by your distribution yourself (seek help online) + - or turn off the `option(SQLITE_ENABLE_COLUMN_METADATA "Enable Column::getColumnOriginName(). Require support from sqlite3 library." ON)` in [CMakeFiles.txt](CMakeFiles.txt) (or other build system scripts) + - or turn on the `option(SQLITECPP_INTERNAL_SQLITE "Add the internal SQLite3 source to the project." ON)` in [CMakeFiles.txt](CMakeFiles.txt) + +### Continuous Integration + +This project is continuously tested under Ubuntu Linux with the gcc and clang compilers +using the Travis CI community service with the above CMake building and testing procedure. +It is also tested in the same way under Windows Server 2012 R2 with Visual Studio 2013 compiler +using the AppVeyor continuous integration service. + +Detailed results can be seen online: + - [https://travis-ci.org/SRombauts/SQLiteCpp](https://travis-ci.org/SRombauts/SQLiteCpp) + - [https://ci.appveyor.com/project/SbastienRombauts/SQLiteCpp](https://ci.appveyor.com/project/SbastienRombauts/SQLiteCpp) + +### Thread-safety + +SQLite supports three modes of thread safety, as describe in "SQLite And Multiple Threads": +see [http://www.sqlite.org/threadsafe.html](http://www.sqlite.org/threadsafe.html) + +This SQLiteC++ wrapper does no add any locks (no mutexes) nor any other thread-safety mechanism +above the SQLite library itself, by design, for lightness and speed. + +Thus, SQLiteC++ naturally supports the "Multi Thread" mode of SQLite: +"In this mode, SQLite can be safely used by multiple threads +provided that no single database connection is used simultaneously in two or more threads." + +But SQLiteC++ does not support the fully thread-safe "Serialized" mode of SQLite, +because of the way it shares the underlying SQLite precompiled statement +in a custom shared pointer (See the inner class "Statement::Ptr"). + +### Valgrind memcheck + +Run valgrind to search for memory leaks in your application, the SQLiteCpp wrapper, or the sqlite3 library. +Execute the following command under Unix like OS (Linux, MacOS or WSL2/Ubuntu under Windows Subsystem for Linux): + +```Shell +valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes --verbose build/SQLiteCpp_example1 +``` + +or uncoment the line at the end of [build.sh](build.sh) + +## Examples +### The first sample demonstrates how to query a database and get results: + +```C++ +try +{ + // Open a database file + SQLite::Database db("example.db3"); + + // Compile a SQL query, containing one parameter (index 1) + SQLite::Statement query(db, "SELECT * FROM test WHERE size > ?"); + + // Bind the integer value 6 to the first parameter of the SQL query + query.bind(1, 6); + + // Loop to execute the query step by step, to get rows of result + while (query.executeStep()) + { + // Demonstrate how to get some typed column value + int id = query.getColumn(0); + const char* value = query.getColumn(1); + int size = query.getColumn(2); + + std::cout << "row: " << id << ", " << value << ", " << size << std::endl; + } +} +catch (std::exception& e) +{ + std::cout << "exception: " << e.what() << std::endl; +} +``` + +### The second sample shows how to manage a transaction: + +```C++ +try +{ + SQLite::Database db("transaction.db3", SQLite::OPEN_READWRITE|SQLite::OPEN_CREATE); + + db.exec("DROP TABLE IF EXISTS test"); + + // Begin transaction + SQLite::Transaction transaction(db); + + db.exec("CREATE TABLE test (id INTEGER PRIMARY KEY, value TEXT)"); + + int nb = db.exec("INSERT INTO test VALUES (NULL, \"test\")"); + std::cout << "INSERT INTO test VALUES (NULL, \"test\")\", returned " << nb << std::endl; + + // Commit transaction + transaction.commit(); +} +catch (std::exception& e) +{ + std::cout << "exception: " << e.what() << std::endl; +} +``` + +### How to handle assertion in SQLiteC++: +Exceptions shall not be used in destructors, so SQLiteC++ uses SQLITECPP_ASSERT() to check for errors in destructors. +If you don't want assert() to be called, you have to enable and define an assert handler as shown below, +and by setting the flag SQLITECPP_ENABLE_ASSERT_HANDLER when compiling the lib. + +```C++ +#ifdef SQLITECPP_ENABLE_ASSERT_HANDLER +namespace SQLite +{ +/// definition of the assertion handler enabled when SQLITECPP_ENABLE_ASSERT_HANDLER is defined in the project (CMakeList.txt) +void assertion_failed(const char* apFile, const long apLine, const char* apFunc, const char* apExpr, const char* apMsg) +{ + // Print a message to the standard error output stream, and abort the program. + std::cerr << apFile << ":" << apLine << ":" << " error: assertion failed (" << apExpr << ") in " << apFunc << "() with message \"" << apMsg << "\"\n"; + std::abort(); +} +} +#endif +``` + +## How to contribute +### GitHub website +The most efficient way to help and contribute to this wrapper project is to +use the tools provided by GitHub: +- please fill bug reports and feature requests here: [https://github.com/SRombauts/SQLiteCpp/issues](https://github.com/SRombauts/SQLiteCpp/issues) +- fork the repository, make some small changes and submit them with pull-request + +### Contact +You can also email me directly, I will try to answer questions and requests whenever I get the time for it. + +### Coding Style Guidelines +The source code use the CamelCase naming style variant where: +- type names (class, struct, typedef, enums...) begin with a capital letter +- files (.cpp/.h) are named like the class they contain +- function and variable names begin with a lower case letter +- member variables begin with a 'm', function arguments begin with a 'a', booleans with a 'b', pointers with a 'p' +- each file, class, method and member variable is documented using Doxygen tags +- braces on their own line +See also [http://www.appinf.com/download/CppCodingStyleGuide.pdf](http://www.appinf.com/download/CppCodingStyleGuide.pdf) for good guidelines + +## See also - Some other simple C++ SQLite wrappers: + +See bellow a short comparison of other wrappers done at the time of writing: + - [sqdbcpp](http://code.google.com/p/sqdbcpp/): RAII design, simple, no dependencies, UTF-8/UTF-16, new BSD license + - [sqlite3cc](http://ed.am/dev/sqlite3cc): uses boost, modern design, LPGPL + - [sqlite3pp](https://github.com/iwongu/sqlite3pp): modern design inspired by boost, MIT License + - [SQLite++](http://sqlitepp.berlios.de/): uses boost build system, Boost License 1.0 + - [CppSQLite](http://www.codeproject.com/Articles/6343/CppSQLite-C-Wrapper-for-SQLite/): famous Code Project but old design, BSD License + - [easySQLite](http://code.google.com/p/easysqlite/): manages table as structured objects, complex + - [sqlite_modern_cpp](https://github.com/keramer/sqlite_modern_cpp): modern C++11, all in one file, MIT license + - [sqlite_orm](https://github.com/fnc12/sqlite_orm): modern C++14, header only all in one file, no raw string queries, BSD-3 license diff --git a/examples/example1/main.cpp b/examples/example1/main.cpp index 16494ffb..80885cdc 100644 --- a/examples/example1/main.cpp +++ b/examples/example1/main.cpp @@ -4,7 +4,7 @@ * * Demonstrates how-to use the SQLite++ wrapper * - * Copyright (c) 2012-2022 Sebastien Rombauts (sebastien.rombauts@gmail.com) + * Copyright (c) 2012-2023 Sebastien Rombauts (sebastien.rombauts@gmail.com) * * Distributed under the MIT License (MIT) (See accompanying file LICENSE.txt * or copy at http://opensource.org/licenses/MIT) diff --git a/examples/example2/CMakeLists.txt b/examples/example2/CMakeLists.txt index 9c827c2a..3257b3e7 100644 --- a/examples/example2/CMakeLists.txt +++ b/examples/example2/CMakeLists.txt @@ -1,6 +1,6 @@ # Example CMake file for compiling & linking a project with the the SQLiteCpp wrapper # -# Copyright (c) 2012-2021 Sebastien Rombauts (sebastien.rombauts@gmail.com) +# Copyright (c) 2012-2023 Sebastien Rombauts (sebastien.rombauts@gmail.com) # # Distributed under the MIT License (MIT) (See accompanying file LICENSE.txt # or copy at http://opensource.org/licenses/MIT) diff --git a/examples/example2/build.bat b/examples/example2/build.bat index db842c13..d848a700 100644 --- a/examples/example2/build.bat +++ b/examples/example2/build.bat @@ -1,21 +1,21 @@ -@REM Copyright (c) 2012-2020 Sebastien Rombauts (sebastien.rombauts@gmail.com) -@REM -@REM Distributed under the MIT License (MIT) (See accompanying file LICENSE.txt -@REM or copy at http://opensource.org/licenses/MIT) -mkdir build -cd build - -@REM Generate a Visual Studio solution for latest version found -cmake .. -@if ERRORLEVEL 1 goto onError - -@REM Build default configuration (ie 'Debug') -cmake --build . -@if ERRORLEVEL 1 goto onError - -goto onSuccess - -:onError -@echo An error occured! -:onSuccess -cd .. +@REM Copyright (c) 2012-2023 Sebastien Rombauts (sebastien.rombauts@gmail.com) +@REM +@REM Distributed under the MIT License (MIT) (See accompanying file LICENSE.txt +@REM or copy at http://opensource.org/licenses/MIT) +mkdir build +cd build + +@REM Generate a Visual Studio solution for latest version found +cmake .. +@if ERRORLEVEL 1 goto onError + +@REM Build default configuration (ie 'Debug') +cmake --build . +@if ERRORLEVEL 1 goto onError + +goto onSuccess + +:onError +@echo An error occured! +:onSuccess +cd .. diff --git a/examples/example2/build.sh b/examples/example2/build.sh index 9fb1bede..8dddf984 100644 --- a/examples/example2/build.sh +++ b/examples/example2/build.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (c) 2012-2020 Sébastien Rombauts (sebastien.rombauts@gmail.com) +# Copyright (c) 2012-2023 Sébastien Rombauts (sebastien.rombauts@gmail.com) # # Distributed under the MIT License (MIT) (See accompanying file LICENSE.txt # or copy at http://opensource.org/licenses/MIT) diff --git a/examples/example2/src/main.cpp b/examples/example2/src/main.cpp index ec8c8753..6d9c75f4 100644 --- a/examples/example2/src/main.cpp +++ b/examples/example2/src/main.cpp @@ -4,7 +4,7 @@ * * Demonstrates how-to use the SQLite++ wrapper * - * Copyright (c) 2012-2020 Sebastien Rombauts (sebastien.rombauts@gmail.com) + * Copyright (c) 2012-2023 Sebastien Rombauts (sebastien.rombauts@gmail.com) * * Distributed under the MIT License (MIT) (See accompanying file LICENSE.txt * or copy at http://opensource.org/licenses/MIT) diff --git a/include/SQLiteCpp/Assertion.h b/include/SQLiteCpp/Assertion.h index 26dbdba8..3d404e2d 100644 --- a/include/SQLiteCpp/Assertion.h +++ b/include/SQLiteCpp/Assertion.h @@ -3,7 +3,7 @@ * @ingroup SQLiteCpp * @brief Definition of the SQLITECPP_ASSERT() macro. * - * Copyright (c) 2012-2022 Sebastien Rombauts (sebastien.rombauts@gmail.com) + * Copyright (c) 2012-2023 Sebastien Rombauts (sebastien.rombauts@gmail.com) * * Distributed under the MIT License (MIT) (See accompanying file LICENSE.txt * or copy at http://opensource.org/licenses/MIT) diff --git a/include/SQLiteCpp/Backup.h b/include/SQLiteCpp/Backup.h index ecd6e0e4..aa685fb0 100644 --- a/include/SQLiteCpp/Backup.h +++ b/include/SQLiteCpp/Backup.h @@ -4,7 +4,7 @@ * @brief Backup is used to backup a database file in a safe and online way. * * Copyright (c) 2015 Shibao HONG (shibaohong@outlook.com) - * Copyright (c) 2015-2022 Sebastien Rombauts (sebastien.rombauts@gmail.com) + * Copyright (c) 2015-2023 Sebastien Rombauts (sebastien.rombauts@gmail.com) * * Distributed under the MIT License (MIT) (See accompanying file LICENSE.txt * or copy at http://opensource.org/licenses/MIT) diff --git a/include/SQLiteCpp/Column.h b/include/SQLiteCpp/Column.h index c177b8c6..81af4042 100644 --- a/include/SQLiteCpp/Column.h +++ b/include/SQLiteCpp/Column.h @@ -3,7 +3,7 @@ * @ingroup SQLiteCpp * @brief Encapsulation of a Column in a row of the result pointed by the prepared SQLite::Statement. * - * Copyright (c) 2012-2022 Sebastien Rombauts (sebastien.rombauts@gmail.com) + * Copyright (c) 2012-2023 Sebastien Rombauts (sebastien.rombauts@gmail.com) * * Distributed under the MIT License (MIT) (See accompanying file LICENSE.txt * or copy at http://opensource.org/licenses/MIT) diff --git a/include/SQLiteCpp/Database.h b/include/SQLiteCpp/Database.h index 4db8dfcb..4475324f 100644 --- a/include/SQLiteCpp/Database.h +++ b/include/SQLiteCpp/Database.h @@ -3,7 +3,7 @@ * @ingroup SQLiteCpp * @brief Management of a SQLite Database Connection. * - * Copyright (c) 2012-2022 Sebastien Rombauts (sebastien.rombauts@gmail.com) + * Copyright (c) 2012-2023 Sebastien Rombauts (sebastien.rombauts@gmail.com) * * Distributed under the MIT License (MIT) (See accompanying file LICENSE.txt * or copy at http://opensource.org/licenses/MIT) diff --git a/include/SQLiteCpp/Exception.h b/include/SQLiteCpp/Exception.h index 8e30c33d..b8231cd1 100644 --- a/include/SQLiteCpp/Exception.h +++ b/include/SQLiteCpp/Exception.h @@ -3,7 +3,7 @@ * @ingroup SQLiteCpp * @brief Encapsulation of the error message from SQLite3 on a std::runtime_error. * - * Copyright (c) 2012-2022 Sebastien Rombauts (sebastien.rombauts@gmail.com) + * Copyright (c) 2012-2023 Sebastien Rombauts (sebastien.rombauts@gmail.com) * * Distributed under the MIT License (MIT) (See accompanying file LICENSE.txt * or copy at http://opensource.org/licenses/MIT) diff --git a/include/SQLiteCpp/ExecuteMany.h b/include/SQLiteCpp/ExecuteMany.h index a22abdd3..b5de3a23 100644 --- a/include/SQLiteCpp/ExecuteMany.h +++ b/include/SQLiteCpp/ExecuteMany.h @@ -4,7 +4,7 @@ * @brief Convenience function to execute a Statement with multiple Parameter sets * * Copyright (c) 2019 Maximilian Bachmann (contact@maxbachmann.de) - * Copyright (c) 2019-2022 Sebastien Rombauts (sebastien.rombauts@gmail.com) + * Copyright (c) 2019-2023 Sebastien Rombauts (sebastien.rombauts@gmail.com) * * Distributed under the MIT License (MIT) (See accompanying file LICENSE.txt * or copy at http://opensource.org/licenses/MIT) diff --git a/include/SQLiteCpp/SQLiteCpp.h b/include/SQLiteCpp/SQLiteCpp.h index 94751b67..106cbc6f 100644 --- a/include/SQLiteCpp/SQLiteCpp.h +++ b/include/SQLiteCpp/SQLiteCpp.h @@ -5,7 +5,7 @@ * * Include this main header file in your project to gain access to all functionality provided by the wrapper. * - * Copyright (c) 2012-2022 Sebastien Rombauts (sebastien.rombauts@gmail.com) + * Copyright (c) 2012-2023 Sebastien Rombauts (sebastien.rombauts@gmail.com) * * Distributed under the MIT License (MIT) (See accompanying file LICENSE.txt * or copy at http://opensource.org/licenses/MIT) diff --git a/include/SQLiteCpp/SQLiteCppExport.h b/include/SQLiteCpp/SQLiteCppExport.h index 4aa1e526..d6e9a06a 100644 --- a/include/SQLiteCpp/SQLiteCppExport.h +++ b/include/SQLiteCpp/SQLiteCppExport.h @@ -4,7 +4,7 @@ * @brief File with macros needed in the generation of Windows DLLs * * - * Copyright (c) 2012-2022 Sebastien Rombauts (sebastien.rombauts@gmail.com) + * Copyright (c) 2012-2023 Sebastien Rombauts (sebastien.rombauts@gmail.com) * * Distributed under the MIT License (MIT) (See accompanying file LICENSE.txt * or copy at http://opensource.org/licenses/MIT) diff --git a/include/SQLiteCpp/Savepoint.h b/include/SQLiteCpp/Savepoint.h index febe0468..8dd5e894 100644 --- a/include/SQLiteCpp/Savepoint.h +++ b/include/SQLiteCpp/Savepoint.h @@ -5,7 +5,7 @@ * secured operation. Similar to a transaction while allowing child savepoints. * * Copyright (c) 2020 Kelvin Hammond (hammond.kelvin@gmail.com) - * Copyright (c) 2020-2022 Sebastien Rombauts (sebastien.rombauts@gmail.com) + * Copyright (c) 2020-2023 Sebastien Rombauts (sebastien.rombauts@gmail.com) * * Distributed under the MIT License (MIT) (See accompanying file LICENSE.txt or * copy at http://opensource.org/licenses/MIT) diff --git a/include/SQLiteCpp/Statement.h b/include/SQLiteCpp/Statement.h index 3442ed98..ba846a8d 100644 --- a/include/SQLiteCpp/Statement.h +++ b/include/SQLiteCpp/Statement.h @@ -3,7 +3,7 @@ * @ingroup SQLiteCpp * @brief A prepared SQLite Statement is a compiled SQL query ready to be executed, pointing to a row of result. * - * Copyright (c) 2012-2022 Sebastien Rombauts (sebastien.rombauts@gmail.com) + * Copyright (c) 2012-2023 Sebastien Rombauts (sebastien.rombauts@gmail.com) * * Distributed under the MIT License (MIT) (See accompanying file LICENSE.txt * or copy at http://opensource.org/licenses/MIT) diff --git a/include/SQLiteCpp/Transaction.h b/include/SQLiteCpp/Transaction.h index 83fb1c4f..305de30a 100644 --- a/include/SQLiteCpp/Transaction.h +++ b/include/SQLiteCpp/Transaction.h @@ -3,7 +3,7 @@ * @ingroup SQLiteCpp * @brief A Transaction is way to group multiple SQL statements into an atomic secured operation. * - * Copyright (c) 2012-2022 Sebastien Rombauts (sebastien.rombauts@gmail.com) + * Copyright (c) 2012-2023 Sebastien Rombauts (sebastien.rombauts@gmail.com) * * Distributed under the MIT License (MIT) (See accompanying file LICENSE.txt * or copy at http://opensource.org/licenses/MIT) diff --git a/include/SQLiteCpp/Utils.h b/include/SQLiteCpp/Utils.h index 56f5a4be..7845ec0e 100644 --- a/include/SQLiteCpp/Utils.h +++ b/include/SQLiteCpp/Utils.h @@ -3,7 +3,7 @@ * @ingroup SQLiteCpp * @brief Definition of the SQLITECPP_PURE_FUNC macro. * - * Copyright (c) 2012-2022 Sebastien Rombauts (sebastien.rombauts@gmail.com) + * Copyright (c) 2012-2023 Sebastien Rombauts (sebastien.rombauts@gmail.com) * * Distributed under the MIT License (MIT) (See accompanying file LICENSE.txt * or copy at http://opensource.org/licenses/MIT) diff --git a/include/SQLiteCpp/VariadicBind.h b/include/SQLiteCpp/VariadicBind.h index 559003e6..3261da4d 100644 --- a/include/SQLiteCpp/VariadicBind.h +++ b/include/SQLiteCpp/VariadicBind.h @@ -4,7 +4,7 @@ * @brief Convenience function for Statement::bind(...) * * Copyright (c) 2016 Paul Dreik (github@pauldreik.se) - * Copyright (c) 2016-2022 Sebastien Rombauts (sebastien.rombauts@gmail.com) + * Copyright (c) 2016-2023 Sebastien Rombauts (sebastien.rombauts@gmail.com) * Copyright (c) 2019 Maximilian Bachmann (contact@maxbachmann.de) * * Distributed under the MIT License (MIT) (See accompanying file LICENSE.txt diff --git a/sqlite3/CMakeLists.txt b/sqlite3/CMakeLists.txt index b3dc73ac..84517b4b 100644 --- a/sqlite3/CMakeLists.txt +++ b/sqlite3/CMakeLists.txt @@ -1,6 +1,6 @@ # CMake file for compiling the sqlite3 static library under Windows (for ease of use) # -# Copyright (c) 2012-2022 Sebastien Rombauts (sebastien.rombauts@gmail.com) +# Copyright (c) 2012-2023 Sebastien Rombauts (sebastien.rombauts@gmail.com) # # Distributed under the MIT License (MIT) (See accompanying file LICENSE.txt # or copy at http://opensource.org/licenses/MIT) diff --git a/src/Backup.cpp b/src/Backup.cpp index d021a249..a2bc23ee 100644 --- a/src/Backup.cpp +++ b/src/Backup.cpp @@ -4,7 +4,7 @@ * @brief Backup is used to backup a database file in a safe and online way. * * Copyright (c) 2015 Shibao HONG (shibaohong@outlook.com) - * Copyright (c) 2015-2022 Sebastien Rombauts (sebastien.rombauts@gmail.com) + * Copyright (c) 2015-2023 Sebastien Rombauts (sebastien.rombauts@gmail.com) * * Distributed under the MIT License (MIT) (See accompanying file LICENSE.txt * or copy at http://opensource.org/licenses/MIT) diff --git a/src/Column.cpp b/src/Column.cpp index cbb76f6e..436cfd2d 100644 --- a/src/Column.cpp +++ b/src/Column.cpp @@ -3,7 +3,7 @@ * @ingroup SQLiteCpp * @brief Encapsulation of a Column in a row of the result pointed by the prepared SQLite::Statement. * - * Copyright (c) 2012-2022 Sebastien Rombauts (sebastien.rombauts@gmail.com) + * Copyright (c) 2012-2023 Sebastien Rombauts (sebastien.rombauts@gmail.com) * * Distributed under the MIT License (MIT) (See accompanying file LICENSE.txt * or copy at http://opensource.org/licenses/MIT) diff --git a/src/Database.cpp b/src/Database.cpp index f4c36832..f0d8d282 100644 --- a/src/Database.cpp +++ b/src/Database.cpp @@ -3,7 +3,7 @@ * @ingroup SQLiteCpp * @brief Management of a SQLite Database Connection. * - * Copyright (c) 2012-2022 Sebastien Rombauts (sebastien.rombauts@gmail.com) + * Copyright (c) 2012-2023 Sebastien Rombauts (sebastien.rombauts@gmail.com) * * Distributed under the MIT License (MIT) (See accompanying file LICENSE.txt * or copy at http://opensource.org/licenses/MIT) diff --git a/src/Exception.cpp b/src/Exception.cpp index ffa25b8c..8f21f406 100644 --- a/src/Exception.cpp +++ b/src/Exception.cpp @@ -3,7 +3,7 @@ * @ingroup SQLiteCpp * @brief Encapsulation of the error message from SQLite3 on a std::runtime_error. * - * Copyright (c) 2012-2022 Sebastien Rombauts (sebastien.rombauts@gmail.com) + * Copyright (c) 2012-2023 Sebastien Rombauts (sebastien.rombauts@gmail.com) * * Distributed under the MIT License (MIT) (See accompanying file LICENSE.txt * or copy at http://opensource.org/licenses/MIT) diff --git a/src/Savepoint.cpp b/src/Savepoint.cpp index bf9a3795..c66bf5f9 100644 --- a/src/Savepoint.cpp +++ b/src/Savepoint.cpp @@ -5,7 +5,7 @@ * secured operation. Similar to a transaction while allowing child savepoints. * * Copyright (c) 2020 Kelvin Hammond (hammond.kelvin@gmail.com) - * Copyright (c) 2020-2022 Sebastien Rombauts (sebastien.rombauts@gmail.com) + * Copyright (c) 2020-2023 Sebastien Rombauts (sebastien.rombauts@gmail.com) * * Distributed under the MIT License (MIT) (See accompanying file LICENSE.txt or * copy at http://opensource.org/licenses/MIT) diff --git a/src/Statement.cpp b/src/Statement.cpp index caaf4d38..50ebe7a9 100644 --- a/src/Statement.cpp +++ b/src/Statement.cpp @@ -3,7 +3,7 @@ * @ingroup SQLiteCpp * @brief A prepared SQLite Statement is a compiled SQL query ready to be executed, pointing to a row of result. * - * Copyright (c) 2012-2022 Sebastien Rombauts (sebastien.rombauts@gmail.com) + * Copyright (c) 2012-2023 Sebastien Rombauts (sebastien.rombauts@gmail.com) * * Distributed under the MIT License (MIT) (See accompanying file LICENSE.txt * or copy at http://opensource.org/licenses/MIT) diff --git a/src/Transaction.cpp b/src/Transaction.cpp index 2003e272..9beca3b4 100644 --- a/src/Transaction.cpp +++ b/src/Transaction.cpp @@ -3,7 +3,7 @@ * @ingroup SQLiteCpp * @brief A Transaction is way to group multiple SQL statements into an atomic secured operation. * - * Copyright (c) 2012-2022 Sebastien Rombauts (sebastien.rombauts@gmail.com) + * Copyright (c) 2012-2023 Sebastien Rombauts (sebastien.rombauts@gmail.com) * * Distributed under the MIT License (MIT) (See accompanying file LICENSE.txt * or copy at http://opensource.org/licenses/MIT) diff --git a/tests/Column_test.cpp b/tests/Column_test.cpp index 3a41a273..7506f816 100644 --- a/tests/Column_test.cpp +++ b/tests/Column_test.cpp @@ -3,7 +3,7 @@ * @ingroup tests * @brief Test of a SQLiteCpp Column. * - * Copyright (c) 2012-2021 Sebastien Rombauts (sebastien.rombauts@gmail.com) + * Copyright (c) 2012-2023 Sebastien Rombauts (sebastien.rombauts@gmail.com) * * Distributed under the MIT License (MIT) (See accompanying file LICENSE.txt * or copy at http://opensource.org/licenses/MIT) diff --git a/tests/Database_test.cpp b/tests/Database_test.cpp index 49653a0b..87eadb53 100644 --- a/tests/Database_test.cpp +++ b/tests/Database_test.cpp @@ -3,7 +3,7 @@ * @ingroup tests * @brief Test of a SQLiteCpp Database. * - * Copyright (c) 2012-2021 Sebastien Rombauts (sebastien.rombauts@gmail.com) + * Copyright (c) 2012-2023 Sebastien Rombauts (sebastien.rombauts@gmail.com) * * Distributed under the MIT License (MIT) (See accompanying file LICENSE.txt * or copy at http://opensource.org/licenses/MIT)