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

+2-1
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

+2-2
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

+1-1
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

+19-10
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

+4-6
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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
FetchContent_MakeAvailable(catch2)
1+
FetchContent_MakeAvailable(Catch2)

dependencies/sqlite3/CMakeLists.txt

+1-1
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

+11-11
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

+5-5
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

+1-1
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";

dev/storage.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,7 @@ namespace sqlite_orm {
586586
static_assert(is_preparable_v<self, Ex>, "Expression must be a high-level statement");
587587

588588
decltype(auto) e2 = static_if<is_select_v<Ex>>(
589-
[](auto expression) -> auto {
589+
[](auto expression) -> auto{
590590
expression.highest_level = true;
591591
return expression;
592592
},

dev/table_name_collector.h

+11-11
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ namespace sqlite_orm {
1717

1818
struct table_name_collector {
1919
using table_name_set = std::set<std::pair<std::string, std::string>>;
20-
using find_table_name_t = std::function<std::string(const std::type_index &)>;
20+
using find_table_name_t = std::function<std::string(const std::type_index&)>;
2121

2222
find_table_name_t find_table_name;
2323
mutable table_name_set table_names;
@@ -27,7 +27,7 @@ namespace sqlite_orm {
2727
table_name_collector(find_table_name_t find_table_name) : find_table_name{move(find_table_name)} {}
2828

2929
template<class T>
30-
table_name_set operator()(const T &) const {
30+
table_name_set operator()(const T&) const {
3131
return {};
3232
}
3333

@@ -37,30 +37,30 @@ namespace sqlite_orm {
3737
}
3838

3939
template<class T, class F>
40-
void operator()(const column_pointer<T, F> &) const {
40+
void operator()(const column_pointer<T, F>&) const {
4141
table_names.emplace(this->find_table_name(typeid(T)), "");
4242
}
4343

4444
template<class T, class C>
45-
void operator()(const alias_column_t<T, C> &a) const {
45+
void operator()(const alias_column_t<T, C>& a) const {
4646
(*this)(a.column, alias_extractor<T>::get());
4747
}
4848

4949
template<class T>
50-
void operator()(const count_asterisk_t<T> &) const {
50+
void operator()(const count_asterisk_t<T>&) const {
5151
auto tableName = this->find_table_name(typeid(T));
5252
if(!tableName.empty()) {
5353
table_names.emplace(move(tableName), "");
5454
}
5555
}
5656

5757
template<class T, satisfies_not<std::is_base_of, alias_tag, T> = true>
58-
void operator()(const asterisk_t<T> &) const {
58+
void operator()(const asterisk_t<T>&) const {
5959
table_names.emplace(this->find_table_name(typeid(T)), "");
6060
}
6161

6262
template<class T, satisfies<std::is_base_of, alias_tag, T> = true>
63-
void operator()(const asterisk_t<T> &) const {
63+
void operator()(const asterisk_t<T>&) const {
6464
// note: not all alias classes have a nested A::type
6565
static_assert(polyfill::is_detected_v<type_t, T>,
6666
"alias<O> must have a nested alias<O>::type typename");
@@ -69,22 +69,22 @@ namespace sqlite_orm {
6969
}
7070

7171
template<class T>
72-
void operator()(const object_t<T> &) const {
72+
void operator()(const object_t<T>&) const {
7373
table_names.emplace(this->find_table_name(typeid(T)), "");
7474
}
7575

7676
template<class T>
77-
void operator()(const table_rowid_t<T> &) const {
77+
void operator()(const table_rowid_t<T>&) const {
7878
table_names.emplace(this->find_table_name(typeid(T)), "");
7979
}
8080

8181
template<class T>
82-
void operator()(const table_oid_t<T> &) const {
82+
void operator()(const table_oid_t<T>&) const {
8383
table_names.emplace(this->find_table_name(typeid(T)), "");
8484
}
8585

8686
template<class T>
87-
void operator()(const table__rowid_t<T> &) const {
87+
void operator()(const table__rowid_t<T>&) const {
8888
table_names.emplace(this->find_table_name(typeid(T)), "");
8989
}
9090
};

dev/transaction_guard.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ namespace sqlite_orm {
3131
connection(std::move(connection_)),
3232
commit_func(move(commit_func_)), rollback_func(move(rollback_func_)) {}
3333

34-
transaction_guard_t(transaction_guard_t &&other) :
34+
transaction_guard_t(transaction_guard_t&& other) :
3535
commit_on_destroy(other.commit_on_destroy), connection(std::move(other.connection)),
3636
commit_func(move(other.commit_func)), rollback_func(move(other.rollback_func)),
3737
gotta_fire(other.gotta_fire) {
@@ -48,7 +48,7 @@ namespace sqlite_orm {
4848
}
4949
}
5050

51-
transaction_guard_t &operator=(transaction_guard_t &&) = delete;
51+
transaction_guard_t& operator=(transaction_guard_t&&) = delete;
5252

5353
/**
5454
* Call `COMMIT` explicitly. After this call

dev/triggers.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ namespace sqlite_orm {
4040
partial_trigger_t(T trigger_base, S... statements) :
4141
base{std::move(trigger_base)}, statements{std::make_tuple<S...>(std::forward<S>(statements)...)} {}
4242

43-
partial_trigger_t &end() {
43+
partial_trigger_t& end() {
4444
return *this;
4545
}
4646
};
@@ -109,7 +109,7 @@ namespace sqlite_orm {
109109

110110
trigger_base_t(trigger_type_base type_base_) : type_base(std::move(type_base_)) {}
111111

112-
trigger_base_t &for_each_row() {
112+
trigger_base_t& for_each_row() {
113113
this->do_for_each_row = true;
114114
return *this;
115115
}
@@ -270,7 +270,7 @@ namespace sqlite_orm {
270270
}
271271

272272
template<class T, class... S>
273-
internal::trigger_t<T, S...> make_trigger(std::string name, const internal::partial_trigger_t<T, S...> &part) {
273+
internal::trigger_t<T, S...> make_trigger(std::string name, const internal::partial_trigger_t<T, S...>& part) {
274274
SQLITE_ORM_CLANG_SUPPRESS_MISSING_BRACES(return {move(name), std::move(part.base), std::move(part.statements)});
275275
}
276276

0 commit comments

Comments
 (0)