Skip to content

Commit 68ec248

Browse files
authored
Merge pull request #1125 from fnc12/dev
1.8.1
2 parents 4861e40 + f4b8000 commit 68ec248

File tree

160 files changed

+554
-370
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

160 files changed

+554
-370
lines changed

.clang-format

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ ConstructorInitializerAllOnOneLineOrOnePerLine: false
5454
ConstructorInitializerIndentWidth: 4
5555
ContinuationIndentWidth: 4
5656
Cpp11BracedListStyle: true
57-
DerivePointerAlignment: true
57+
DerivePointerAlignment: false
5858
DisableFormat: false
5959
ExperimentalAutoDetectBinPacking: false
6060
FixNamespaceComments: false
@@ -94,6 +94,7 @@ PenaltyBreakString: 1000
9494
PenaltyBreakTemplateDeclaration: 10
9595
PenaltyExcessCharacter: 1000000
9696
PenaltyReturnTypeOnItsOwnLine: 60
97+
PointerAlignment: Left
9798
ReflowComments: false
9899
SortIncludes: false
99100
SortUsingDeclarations: true

.github/workflows/clang-format-lint.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ jobs:
99
steps:
1010
- uses: actions/checkout@v1
1111
- name: clang-format lint
12-
uses: DoozyX/clang-format-lint-action@v0.12
12+
uses: DoozyX/clang-format-lint-action@v0.15
1313
with:
14-
clangFormatVersion: 12
14+
clangFormatVersion: 15

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ set(CMAKE_CXX_EXTENSIONS OFF)
2828

2929
set(CMAKE_VERBOSE_MAKEFILE ON)
3030

31-
message(STATUS "Configuring ${CMAKE_PROJECT_NAME} ${sqlite_orm_VERSION}")
31+
message(STATUS "Configuring ${PROJECT_NAME} ${sqlite_orm_VERSION}")
3232

3333
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
3434

appveyor.yml

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ environment:
3333
SQLITE_ORM_CXX_STANDARD: "-DSQLITE_ORM_ENABLE_CXX_14=ON"
3434

3535
# Representative for C++14
36-
- job_name: Visual Studio 2015 Update 3, x64, C++14
37-
appveyor_build_worker_image: Visual Studio 2015
36+
- job_name: Visual Studio 2022, x64, C++14
37+
appveyor_build_worker_image: Visual Studio 2022
3838
platform: x64
3939
SQLITE_ORM_CXX_STANDARD: ""
4040

@@ -96,13 +96,18 @@ for:
9696
if "%appveyor_build_worker_image%"=="Visual Studio 2015" (set generator="Visual Studio 14 2015" %architecture%)
9797
install:
9898
- |-
99+
cd C:\Tools\vcpkg
100+
git fetch --tags && git checkout 2023.01.09
101+
cd %APPVEYOR_BUILD_FOLDER%
102+
C:\Tools\vcpkg\bootstrap-vcpkg.bat -disableMetrics
99103
C:\Tools\vcpkg\vcpkg integrate install
100-
vcpkg install sqlite3:%platform%-windows
104+
set VCPKG_DEFAULT_TRIPLET=%platform%-windows
105+
vcpkg install sqlite3 catch2
101106
before_build:
102107
- |-
103108
mkdir compile
104109
cd compile
105-
cmake %SQLITE_ORM_CXX_STANDARD% -DSqliteOrm_BuildTests=ON .. -G %generator% -DCMAKE_TOOLCHAIN_FILE=C:/Tools/vcpkg/scripts/buildsystems/vcpkg.cmake
110+
cmake %SQLITE_ORM_CXX_STANDARD% .. -G %generator% -DCMAKE_TOOLCHAIN_FILE=C:/Tools/vcpkg/scripts/buildsystems/vcpkg.cmake
106111
# build examples, and run tests (ie make & make test)
107112
build_script:
108113
- |-
@@ -121,13 +126,17 @@ for:
121126
# using custom vcpkg triplets for building and linking dynamic dependent libraries
122127
install:
123128
- |-
129+
pushd $HOME/vcpkg
130+
git fetch --tags && git checkout 2023.01.09
131+
popd
132+
$HOME/vcpkg/bootstrap-vcpkg.sh -disableMetrics
124133
$HOME/vcpkg/vcpkg integrate install --overlay-triplets=vcpkg/triplets
125-
vcpkg install sqlite3 --overlay-triplets=vcpkg/triplets
134+
vcpkg install sqlite3 catch2 --overlay-triplets=vcpkg/triplets
126135
before_build:
127136
- |-
128137
mkdir compile
129138
cd compile
130-
cmake $SQLITE_ORM_CXX_STANDARD -DSqliteOrm_BuildTests=ON .. -DCMAKE_TOOLCHAIN_FILE=$HOME/vcpkg/scripts/buildsystems/vcpkg.cmake
139+
cmake $SQLITE_ORM_CXX_STANDARD .. -DCMAKE_TOOLCHAIN_FILE=$HOME/vcpkg/scripts/buildsystems/vcpkg.cmake
131140
# build examples, and run tests (ie make & make test)
132141
build_script:
133142
- |-
@@ -145,15 +154,15 @@ for:
145154
# using custom vcpkg triplets for building and linking dynamic dependent libraries
146155
install:
147156
- |-
148-
git clone --depth 1 --branch 2022.05.10 https://github.com/microsoft/vcpkg.git $HOME/vcpkg
149-
$HOME/vcpkg/booststrap.sh
157+
git clone --depth 1 --branch 2023.01.09 https://github.com/microsoft/vcpkg.git $HOME/vcpkg
158+
$HOME/vcpkg/bootstrap-vcpkg.sh -disableMetrics
150159
$HOME/vcpkg/vcpkg integrate install --overlay-triplets=vcpkg/triplets
151-
vcpkg install sqlite3 --overlay-triplets=vcpkg/triplets
160+
vcpkg install sqlite3 catch2 --overlay-triplets=vcpkg/triplets
152161
before_build:
153162
- |-
154163
mkdir compile
155164
cd compile
156-
cmake $SQLITE_ORM_CXX_STANDARD -DSqliteOrm_BuildTests=ON .. -DCMAKE_TOOLCHAIN_FILE=$HOME/vcpkg/scripts/buildsystems/vcpkg.cmake
165+
cmake $SQLITE_ORM_CXX_STANDARD .. -DCMAKE_TOOLCHAIN_FILE=$HOME/vcpkg/scripts/buildsystems/vcpkg.cmake
157166
# build examples, and run tests (ie make & make test)
158167
build_script:
159168
- |-

dependencies/CMakeLists.txt

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,11 @@ include(FetchContent)
22

33
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND BUILD_TESTING)
44
FetchContent_Declare(
5-
catch2
5+
Catch2
66
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
7-
GIT_TAG v2.13.2
7+
GIT_TAG v3.2.1
88
)
9-
endif()
10-
11-
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND BUILD_TESTING)
129
add_subdirectory(catch2)
1310
endif()
14-
add_subdirectory(sqlite3)
11+
12+
add_subdirectory(sqlite3)

dependencies/catch2/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
FetchContent_MakeAvailable(catch2)
1+
FetchContent_MakeAvailable(Catch2)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# find_package exposes targets only globally, but caches them. So call find_package again in the directory of usage
2-
find_package(SQLite3 REQUIRED)
2+
find_package(SQLite3 REQUIRED)

dev/arg_values.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ namespace sqlite_orm {
1010

1111
arg_value() : arg_value(nullptr) {}
1212

13-
arg_value(sqlite3_value *value_) : value(value_) {}
13+
arg_value(sqlite3_value* value_) : value(value_) {}
1414

1515
template<class T>
1616
T get() const {
@@ -47,18 +47,18 @@ namespace sqlite_orm {
4747
}
4848

4949
private:
50-
sqlite3_value *value = nullptr;
50+
sqlite3_value* value = nullptr;
5151
};
5252

5353
struct arg_values {
5454

5555
struct iterator {
5656

57-
iterator(const arg_values &container_, int index_) :
57+
iterator(const arg_values& container_, int index_) :
5858
container(container_), index(index_),
5959
currentValue(index_ < int(container_.size()) ? container_[index_] : arg_value()) {}
6060

61-
iterator &operator++() {
61+
iterator& operator++() {
6262
++this->index;
6363
if(this->index < int(this->container.size())) {
6464
this->currentValue = this->container[this->index];
@@ -87,27 +87,27 @@ namespace sqlite_orm {
8787
}
8888
}
8989

90-
arg_value *operator->() const {
90+
arg_value* operator->() const {
9191
return &this->currentValue;
9292
}
9393

94-
bool operator==(const iterator &other) const {
94+
bool operator==(const iterator& other) const {
9595
return &other.container == &this->container && other.index == this->index;
9696
}
9797

98-
bool operator!=(const iterator &other) const {
98+
bool operator!=(const iterator& other) const {
9999
return !(*this == other);
100100
}
101101

102102
private:
103-
const arg_values &container;
103+
const arg_values& container;
104104
int index = 0;
105105
mutable arg_value currentValue;
106106
};
107107

108108
arg_values() : arg_values(0, nullptr) {}
109109

110-
arg_values(int argsCount_, sqlite3_value **values_) : argsCount(argsCount_), values(values_) {}
110+
arg_values(int argsCount_, sqlite3_value** values_) : argsCount(argsCount_), values(values_) {}
111111

112112
size_t size() const {
113113
return this->argsCount;
@@ -119,7 +119,7 @@ namespace sqlite_orm {
119119

120120
arg_value operator[](int index) const {
121121
if(index < this->argsCount && index >= 0) {
122-
sqlite3_value *value = this->values[index];
122+
sqlite3_value* value = this->values[index];
123123
return {value};
124124
} else {
125125
throw std::system_error{orm_error_code::index_is_out_of_bounds};
@@ -140,6 +140,6 @@ namespace sqlite_orm {
140140

141141
private:
142142
int argsCount = 0;
143-
sqlite3_value **values = nullptr;
143+
sqlite3_value** values = nullptr;
144144
};
145145
}

dev/function.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ namespace sqlite_orm {
2424

2525
struct user_defined_function_base {
2626
using func_call = std::function<
27-
void(sqlite3_context *context, void *functionPointer, int argsCount, sqlite3_value **values)>;
28-
using final_call = std::function<void(sqlite3_context *context, void *functionPointer)>;
27+
void(sqlite3_context* context, void* functionPointer, int argsCount, sqlite3_value** values)>;
28+
using final_call = std::function<void(sqlite3_context* context, void* functionPointer)>;
2929

3030
std::string name;
3131
int argumentsCount = 0;
32-
std::function<int *()> create;
33-
void (*destroy)(int *) = nullptr;
32+
std::function<int*()> create;
33+
void (*destroy)(int*) = nullptr;
3434

3535
#ifndef SQLITE_ORM_AGGREGATE_NSDMI_SUPPORTED
3636
user_defined_function_base(decltype(name) name_,
@@ -162,7 +162,7 @@ namespace sqlite_orm {
162162
constexpr bool is_same_pvt_v<I, PointerArg, nullptr_t, polyfill::void_t<typename PointerArg::tag>> = true;
163163

164164
#if __cplusplus >= 201703L // using C++17 or higher
165-
template<size_t I, const char *PointerArg, const char *Binding>
165+
template<size_t I, const char* PointerArg, const char* Binding>
166166
SQLITE_ORM_CONSTEVAL bool assert_same_pointer_type() {
167167
constexpr bool valid = Binding == PointerArg;
168168
static_assert(valid, "Pointer value types of I-th argument do not match");

dev/statement_serializer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -788,7 +788,7 @@ namespace sqlite_orm {
788788
using statement_type = conflict_clause_t;
789789

790790
template<class Ctx>
791-
std::string operator()(const statement_type& statement, const Ctx& context) const {
791+
std::string operator()(const statement_type& statement, const Ctx&) const {
792792
switch(statement) {
793793
case conflict_clause_t::rollback:
794794
return "ROLLBACK";

0 commit comments

Comments
 (0)