Skip to content

Commit c3dfa76

Browse files
committed
Merge branch 'upstream/dev' into upstream/experimental/threadsafe_connection
2 parents 8285dab + cfc1095 commit c3dfa76

File tree

118 files changed

+939
-167
lines changed

Some content is hidden

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

118 files changed

+939
-167
lines changed

.clang-format

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ SpacesInCStyleCastParentheses: false
118118
SpacesInParentheses: false
119119
SpacesInSquareBrackets: false
120120
Standard: Cpp11
121-
AttributeMacros: [SQLITE_ORM_CPP_LIKELY, SQLITE_ORM_CPP_UNLIKELY]
121+
AttributeMacros: [SQLITE_ORM_CPP_LIKELY, SQLITE_ORM_CPP_UNLIKELY, SQLITE_ORM_EXPORT]
122122
StatementMacros:
123123
- __pragma
124124
- _Pragma

CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,14 @@ set(PACKAGE_VERSION ${sqlite_orm_VERSION})
1111
project("sqlite_orm" VERSION ${PACKAGE_VERSION})
1212

1313
# Handling C++ standard version to use
14+
option(SQLITE_ORM_ENABLE_CXX_23 "Enable C++ 23" OFF)
1415
option(SQLITE_ORM_ENABLE_CXX_20 "Enable C++ 20" OFF)
1516
option(SQLITE_ORM_ENABLE_CXX_17 "Enable C++ 17" OFF)
1617
set(CMAKE_CXX_STANDARD_REQUIRED ON)
17-
if(SQLITE_ORM_ENABLE_CXX_20)
18+
if(SQLITE_ORM_ENABLE_CXX_23)
19+
set(CMAKE_CXX_STANDARD 23)
20+
message(STATUS "SQLITE_ORM: Build with C++23 features")
21+
elseif(SQLITE_ORM_ENABLE_CXX_20)
1822
set(CMAKE_CXX_STANDARD 20)
1923
message(STATUS "SQLITE_ORM: Build with C++20 features")
2024
elseif(SQLITE_ORM_ENABLE_CXX_17)

appveyor.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ configuration:
2020
environment:
2121
appveyor_yml_disable_ps_linux: true
2222
matrix:
23+
- job_name: Visual Studio 2022, x64, C++23
24+
appveyor_build_worker_image: Visual Studio 2022
25+
platform: x64
26+
SQLITE_ORM_CXX_STANDARD: "-DSQLITE_ORM_ENABLE_CXX_23=ON"
27+
2328
- job_name: clang, C++14
2429
appveyor_build_worker_image: Ubuntu
2530
CC: clang

dev/alias.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
#pragma once
22

3+
#ifndef SQLITE_ORM_IMPORT_STD_MODULE
34
#include <type_traits> // std::enable_if, std::is_same
45
#include <utility> // std::make_index_sequence, std::move
56
#include <string> // std::string
67
#include <sstream> // std::stringstream
78
#if (SQLITE_VERSION_NUMBER >= 3008003) && defined(SQLITE_ORM_WITH_CTE)
89
#include <array>
910
#endif
11+
#endif
1012

1113
#include "functional/cxx_type_traits_polyfill.h"
1214
#include "functional/mpl/conditional.h"
@@ -185,7 +187,9 @@ namespace sqlite_orm {
185187
inline constexpr bool is_builtin_numeric_column_alias_v<column_alias<C...>> = ((C >= '0' && C <= '9') && ...);
186188
#endif
187189
}
190+
}
188191

192+
SQLITE_ORM_EXPORT namespace sqlite_orm {
189193
/**
190194
* Using a column pointer, create a column reference to an aliased table column.
191195
*

dev/alias_traits.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,24 @@
11
#pragma once
22

3+
#ifndef SQLITE_ORM_IMPORT_STD_MODULE
34
#include <type_traits> // std::is_base_of, std::is_same
45
#ifdef SQLITE_ORM_WITH_CPP20_ALIASES
56
#include <concepts>
67
#endif
8+
#endif
79

810
#include "functional/cxx_type_traits_polyfill.h"
911
#include "type_traits.h"
1012
#include "table_reference.h"
1113

12-
namespace sqlite_orm {
14+
SQLITE_ORM_EXPORT namespace sqlite_orm {
1315

1416
/** @short Base class for a custom table alias, column alias or expression alias.
1517
*/
1618
struct alias_tag {};
19+
}
1720

21+
namespace sqlite_orm {
1822
namespace internal {
1923

2024
template<class A>
@@ -65,7 +69,9 @@ namespace sqlite_orm {
6569
template<class A>
6670
using is_cte_moniker = polyfill::bool_constant<is_cte_moniker_v<A>>;
6771
}
72+
}
6873

74+
SQLITE_ORM_EXPORT namespace sqlite_orm {
6975
#ifdef SQLITE_ORM_WITH_CPP20_ALIASES
7076
template<class A>
7177
concept orm_alias = std::derived_from<A, alias_tag>;

dev/arg_values.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
#include "row_extractor.h"
66

7-
namespace sqlite_orm {
7+
SQLITE_ORM_EXPORT namespace sqlite_orm {
88

99
/** @short Wrapper around a dynamically typed value object.
1010
*/

dev/arithmetic_tag.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
#pragma once
22

3+
#ifndef SQLITE_ORM_IMPORT_STD_MODULE
34
#include <type_traits> // std::is_integral
5+
#endif
46

57
#include "functional/mpl/conditional.h"
68

7-
namespace sqlite_orm {
9+
SQLITE_ORM_EXPORT namespace sqlite_orm {
810

911
/**
1012
* Helper classes used by statement_binder and row_extractor.

dev/ast/excluded.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#pragma once
22

3+
#ifndef SQLITE_ORM_IMPORT_STD_MODULE
34
#include <utility> // std::move
5+
#endif
46

57
namespace sqlite_orm {
68
namespace internal {
@@ -12,7 +14,9 @@ namespace sqlite_orm {
1214
expression_type expression;
1315
};
1416
}
17+
}
1518

19+
SQLITE_ORM_EXPORT namespace sqlite_orm {
1620
template<class T>
1721
internal::excluded_t<T> excluded(T expression) {
1822
return {std::move(expression)};

dev/ast/exists.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#pragma once
22

3+
#ifndef SQLITE_ORM_IMPORT_STD_MODULE
34
#include <utility> // std::move
5+
#endif
46

57
#include "../tags.h"
68

@@ -17,7 +19,9 @@ namespace sqlite_orm {
1719
exists_t(expression_type expression_) : expression(std::move(expression_)) {}
1820
};
1921
}
22+
}
2023

24+
SQLITE_ORM_EXPORT namespace sqlite_orm {
2125
/**
2226
* EXISTS(condition).
2327
* Example: storage.select(columns(&Agent::code, &Agent::name, &Agent::workingArea, &Agent::comission),

dev/ast/group_by.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
#pragma once
22

3+
#ifndef SQLITE_ORM_IMPORT_STD_MODULE
34
#include <tuple> // std::tuple, std::make_tuple
45
#include <type_traits> // std::true_type, std::false_type
56
#include <utility> // std::forward, std::move
7+
#endif
68

79
#include "../functional/cxx_type_traits_polyfill.h"
810

@@ -37,7 +39,9 @@ namespace sqlite_orm {
3739
using is_group_by = polyfill::disjunction<polyfill::is_specialization_of<T, group_by_t>,
3840
polyfill::is_specialization_of<T, group_by_with_having>>;
3941
}
42+
}
4043

44+
SQLITE_ORM_EXPORT namespace sqlite_orm {
4145
/**
4246
* GROUP BY column.
4347
* Example: storage.get_all<Employee>(group_by(&Employee::name))

dev/ast/into.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ namespace sqlite_orm {
1313
template<class T>
1414
using is_into = polyfill::is_specialization_of<T, into_t>;
1515
}
16+
}
1617

18+
SQLITE_ORM_EXPORT namespace sqlite_orm {
1719
template<class T>
1820
internal::into_t<T> into() {
1921
return {};

dev/ast/match.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#pragma once
22

3-
#include <utility> // std::move
3+
#ifndef SQLITE_ORM_IMPORT_STD_MODULE
4+
#include <utility>
5+
#endif
46

57
namespace sqlite_orm {
68
namespace internal {
@@ -11,11 +13,11 @@ namespace sqlite_orm {
1113
using argument_type = X;
1214

1315
argument_type argument;
14-
15-
match_t(argument_type argument) : argument(std::move(argument)) {}
1616
};
1717
}
18+
}
1819

20+
SQLITE_ORM_EXPORT namespace sqlite_orm {
1921
template<class T, class X>
2022
internal::match_t<T, X> match(X argument) {
2123
return {std::move(argument)};

dev/ast/rank.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ namespace sqlite_orm {
44
namespace internal {
55
struct rank_t {};
66
}
7+
}
78

9+
SQLITE_ORM_EXPORT namespace sqlite_orm {
810
inline internal::rank_t rank() {
911
return {};
1012
}

dev/ast/set.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
#pragma once
22

3+
#ifndef SQLITE_ORM_IMPORT_STD_MODULE
34
#include <tuple> // std::tuple, std::tuple_size
45
#include <string> // std::string
56
#include <vector> // std::vector
67
#include <sstream> // std::stringstream
78
#include <type_traits> // std::false_type, std::true_type
9+
#endif
810

911
#include "../tuple_helper/tuple_traits.h"
1012
#include "../table_name_collector.h"
@@ -85,7 +87,9 @@ namespace sqlite_orm {
8587
template<class C>
8688
struct is_dynamic_set<dynamic_set_t<C>> : std::true_type {};
8789
}
90+
}
8891

92+
SQLITE_ORM_EXPORT namespace sqlite_orm {
8993
/**
9094
* SET keyword used in UPDATE ... SET queries.
9195
* Args must have `assign_t` type. E.g. set(assign(&User::id, 5)) or set(c(&User::id) = 5)

dev/ast/special_keywords.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ namespace sqlite_orm {
66
struct current_date_t {};
77
struct current_timestamp_t {};
88
}
9+
}
910

11+
SQLITE_ORM_EXPORT namespace sqlite_orm {
1012
inline internal::current_time_t current_time() {
1113
return {};
1214
}

dev/ast/upsert_clause.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
#pragma once
22

3+
#ifndef SQLITE_ORM_IMPORT_STD_MODULE
34
#if SQLITE_VERSION_NUMBER >= 3024000
45
#include <tuple> // std::tuple
56
#include <utility> // std::forward, std::move
67
#endif
8+
#endif
79

810
#include "../functional/cxx_type_traits_polyfill.h"
911

@@ -51,7 +53,9 @@ namespace sqlite_orm {
5153
template<class T>
5254
using is_upsert_clause = polyfill::bool_constant<is_upsert_clause_v<T>>;
5355
}
56+
}
5457

58+
SQLITE_ORM_EXPORT namespace sqlite_orm {
5559
#if SQLITE_VERSION_NUMBER >= 3024000
5660
/**
5761
* ON CONFLICT upsert clause builder function.

dev/ast/where.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#pragma once
22

3+
#ifndef SQLITE_ORM_IMPORT_STD_MODULE
34
#include <type_traits> // std::false_type, std::true_type
45
#include <utility> // std::move
6+
#endif
57

68
#include "../functional/cxx_type_traits_polyfill.h"
79
#include "../serialize_result_type.h"
@@ -35,7 +37,9 @@ namespace sqlite_orm {
3537
template<class T>
3638
struct is_where : polyfill::bool_constant<is_where_v<T>> {};
3739
}
40+
}
3841

42+
SQLITE_ORM_EXPORT namespace sqlite_orm {
3943
/**
4044
* WHERE clause. Use it to add WHERE conditions wherever you like.
4145
* C is expression type. Can be any expression like: is_equal_t, is_null_t, exists_t etc

dev/ast_iterator.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#pragma once
22

3+
#ifndef SQLITE_ORM_IMPORT_STD_MODULE
34
#include <vector> // std::vector
45
#include <functional> // std::reference_wrapper
6+
#endif
57

68
#include "tuple_helper/tuple_iteration.h"
79
#include "type_traits.h"

dev/backup.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
#pragma once
22

33
#include <sqlite3.h>
4+
#ifndef SQLITE_ORM_IMPORT_STD_MODULE
45
#include <system_error> // std::system_error
56
#include <string> // std::string
67
#include <memory>
78
#include <utility> // std::move, std::exchange
9+
#endif
810

911
#include "error_code.h"
1012
#include "connection_holder.h"

dev/carray.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
* Hence we make it only available for compilers supporting inline variables.
77
*/
88

9+
#ifndef SQLITE_ORM_IMPORT_STD_MODULE
910
#if SQLITE_VERSION_NUMBER >= 3020000
1011
#ifdef SQLITE_ORM_INLINE_VARIABLES_SUPPORTED
1112
#include <utility> // std::move
@@ -14,12 +15,13 @@
1415
#endif
1516
#endif
1617
#endif
18+
#endif
1719

1820
#include "pointer_value.h"
1921

2022
#if SQLITE_VERSION_NUMBER >= 3020000
2123
#ifdef SQLITE_ORM_INLINE_VARIABLES_SUPPORTED
22-
namespace sqlite_orm {
24+
SQLITE_ORM_EXPORT namespace sqlite_orm {
2325

2426
#ifdef SQLITE_ORM_WITH_CPP20_ALIASES
2527
inline constexpr orm_pointer_type auto carray_pointer_tag = "carray"_pointer_type;

dev/column_expression.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
#pragma once
22

3+
#ifndef SQLITE_ORM_IMPORT_STD_MODULE
34
#include <type_traits> // std::enable_if, std::is_same, std::decay, std::is_arithmetic
45
#include <tuple> // std::tuple
56
#include <functional> // std::reference_wrapper
7+
#endif
68

79
#include "functional/cxx_type_traits_polyfill.h"
810
#include "tuple_helper/tuple_transformer.h"

dev/column_names_getter.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
#pragma once
22

3+
#ifndef SQLITE_ORM_IMPORT_STD_MODULE
34
#include <type_traits> // std::is_base_of
45
#include <string> // std::string
56
#include <vector> // std::vector
67
#include <functional> // std::reference_wrapper
78
#include <system_error>
89
#include <utility> // std::move
10+
#endif
911

1012
#include "tuple_helper/tuple_traits.h"
1113
#include "tuple_helper/tuple_iteration.h"

dev/column_pointer.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#pragma once
22

3+
#ifndef SQLITE_ORM_IMPORT_STD_MODULE
34
#include <type_traits> // std::enable_if, std::is_convertible
45
#include <utility> // std::move
6+
#endif
57

68
#include "functional/cxx_core_features.h"
79
#include "functional/cxx_type_traits_polyfill.h"
@@ -40,7 +42,9 @@ namespace sqlite_orm {
4042
struct alias_holder;
4143
#endif
4244
}
45+
}
4346

47+
SQLITE_ORM_EXPORT namespace sqlite_orm {
4448
/**
4549
* Explicitly refer to a column, used in contexts
4650
* where the automatic object mapping deduction needs to be overridden.

0 commit comments

Comments
 (0)