Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/clang format17 #1369

Closed
wants to merge 55 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
8fadf9e
added if_exists with tests
fnc12 Jul 13, 2024
d2f4014
fixed whitespaces
fnc12 Jul 14, 2024
460067a
Merge pull request #1333 from fnc12/feature/if-exists
fnc12 Jul 15, 2024
26c0b76
Added includes of dependent headers
trueqbit Jul 17, 2024
69b2389
Merge branch 'upstream/dev' into code-quality
trueqbit Jul 17, 2024
b81b407
Update using of internal namespace
trueqbit Jul 18, 2024
c4f3770
Added more storage unit tests
trueqbit Jul 18, 2024
b66c348
Added missing includes to dev/serializing_util.h
trueqbit Jul 19, 2024
d639111
Included <sqlite3.h> explicitly in examples and unit tests
trueqbit Jul 19, 2024
6a96d1c
Explicitly included <cstdint> in examples and unit tests
trueqbit Jul 19, 2024
4bdb5f3
Use std-qualified `std::time_t` in examples
trueqbit Jul 20, 2024
f388350
Removed inclusion of `cxx_universal.h` where it's not needed
trueqbit Jul 20, 2024
2927b2b
No more including of `cxx_universal.h`
trueqbit Jul 20, 2024
c08b5c8
Code formatting of file `dev/ast/match.h`
trueqbit Jul 20, 2024
faa3496
Used C string and stdlib functions again
trueqbit Jul 20, 2024
fb7f62b
Removed irrelevant comment in `cxx_universal.h`
trueqbit Jul 20, 2024
c059cbd
appveyor: Updated vcpkg environment to 2024.07.12
trueqbit Jul 21, 2024
5da3ba3
Corrected messed up #if/#endif pair in `table_reference.h`
trueqbit Jul 21, 2024
bbf93f0
Added feature to use a CTE in a `REPLACE` statement
trueqbit Jul 21, 2024
d5980a4
CTE for raw replace, update all, remove all
trueqbit Jul 21, 2024
cff4a64
More `constexpr` factory functions ...
trueqbit Jul 21, 2024
3110378
Unit tests for serializing the With clause of CRUD expressions
trueqbit Jul 21, 2024
8c15e4b
Merge pull request #1337 from fnc12/code-quality
trueqbit Jul 22, 2024
0d3e1f7
Merge branch 'upstream/dev' into amend-cte
trueqbit Jul 22, 2024
388ed52
Added missing `node_tuple` specialization for bitwise not
trueqbit Jul 23, 2024
766861e
C++ operator overloads for bitwise operators
trueqbit Jul 23, 2024
fcf86d1
Provided a table reference for the "dbstat" eponymous virtual table
trueqbit Jul 23, 2024
37c2ac6
Merge pull request #1339 from fnc12/dbstat_table_reference
trueqbit Jul 23, 2024
caec85b
Merge branch 'upstream/dev' into amend-cte
trueqbit Jul 23, 2024
dd2040e
Added the "unary minus" operator
trueqbit Jul 23, 2024
042825a
Merge branch 'amend-cte' into bitwise-operators
trueqbit Jul 23, 2024
662f4e0
Merge pull request #1338 from fnc12/amend-cte
trueqbit Jul 24, 2024
f770fd3
Merge branch 'upstream/dev' into bitwise-operators
trueqbit Jul 24, 2024
2db5e0f
Merge pull request #1340 from fnc12/bitwise-operators
trueqbit Jul 24, 2024
f51188c
Fix `mapped_view` with condition
stevenwdv Sep 2, 2024
2d089d4
Also update mapped_view.h for #1346
stevenwdv Sep 3, 2024
a2b5fcd
Merge pull request #1347 from stevenwdv/1346-fix-mapped_view-condition
trueqbit Sep 7, 2024
ce2a491
add setter and getter for max_page_count pragma
Sep 18, 2024
2ce3dcf
Merge pull request #1350 from akrisfx/issue/1349
fnc12 Sep 19, 2024
1231e84
added column_pointer support to fk
fnc12 Nov 8, 2024
9a7a760
test simplified
fnc12 Nov 8, 2024
cf82e1e
Merge pull request #1355 from fnc12/bigfux/fk-with-inheritance
fnc12 Nov 9, 2024
e4b075b
fix: null() and not_null() will cause an error when running sync_sche…
uuiid Dec 4, 2024
2a430e1
run amalgamate.py and clang-format
uuiid Dec 4, 2024
6c95752
add issue1357 test
uuiid Dec 4, 2024
5db0351
add issue1357.cpp to cmake file
uuiid Dec 4, 2024
886beac
fix: the issue of reverse results when checking null constraints
uuiid Dec 5, 2024
0da82b0
Merge pull request #1357 from uuiid/dev
fnc12 Dec 5, 2024
9d539a4
added locking mode
fnc12 Dec 10, 2024
fe76354
Merge pull request #1359 from fnc12/feature/pragma-locking-mode
fnc12 Dec 11, 2024
a6d8df0
added any example
fnc12 Dec 14, 2024
1c1d4f0
Merge pull request #1363 from fnc12/any-example
fnc12 Dec 15, 2024
49f5e52
added pragma once
fnc12 Dec 16, 2024
dca1fa3
Merge pull request #1366 from fnc12/bugfix/locking-mode-pragma-once
fnc12 Dec 16, 2024
4d4a76c
Testing clang-format 17.0.1
juandent Dec 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Run unit_tests",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build/tests/unit_tests",
"args": [],
"cwd": "${workspaceFolder}",
"stopAtEntry": false,
"environment": [],
"externalConsole": false,
"MIMode": "lldb"
},
{
"name": "Run amalgamate script",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/third_party/amalgamate/amalgamate.py",
"args": [
"-c", "${workspaceFolder}/third_party/amalgamate/config.json",
"-s", "${workspaceFolder}"
],
"cwd": "${workspaceFolder}",
"console": "integratedTerminal"
}
]
}
79 changes: 79 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
{
"files.associations": {
"*.c": "c",
"string": "cpp",
"__bit_reference": "cpp",
"__hash_table": "cpp",
"__split_buffer": "cpp",
"__tree": "cpp",
"array": "cpp",
"deque": "cpp",
"forward_list": "cpp",
"initializer_list": "cpp",
"list": "cpp",
"map": "cpp",
"set": "cpp",
"span": "cpp",
"string_view": "cpp",
"unordered_map": "cpp",
"vector": "cpp",
"chrono": "cpp",
"format": "cpp",
"ranges": "cpp",
"text_encoding": "cpp",
"__locale": "cpp",
"__node_handle": "cpp",
"__verbose_abort": "cpp",
"bitset": "cpp",
"cctype": "cpp",
"charconv": "cpp",
"cmath": "cpp",
"codecvt": "cpp",
"cstdarg": "cpp",
"cstddef": "cpp",
"cstdint": "cpp",
"cstdio": "cpp",
"cstdlib": "cpp",
"cstring": "cpp",
"ctime": "cpp",
"cwchar": "cpp",
"cwctype": "cpp",
"memory": "cpp",
"iomanip": "cpp",
"ios": "cpp",
"iosfwd": "cpp",
"istream": "cpp",
"limits": "cpp",
"locale": "cpp",
"mutex": "cpp",
"new": "cpp",
"optional": "cpp",
"ostream": "cpp",
"print": "cpp",
"ratio": "cpp",
"sstream": "cpp",
"stdexcept": "cpp",
"streambuf": "cpp",
"tuple": "cpp",
"typeindex": "cpp",
"typeinfo": "cpp",
"variant": "cpp",
"algorithm": "cpp",
"clocale": "cpp",
"atomic": "cpp",
"bit": "cpp",
"*.tcc": "cpp",
"compare": "cpp",
"concepts": "cpp",
"exception": "cpp",
"functional": "cpp",
"iterator": "cpp",
"memory_resource": "cpp",
"random": "cpp",
"system_error": "cpp",
"type_traits": "cpp",
"utility": "cpp",
"__config": "cpp",
"any": "cpp"
}
}
70 changes: 70 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "Run unit_tests",
"type": "shell",
"command": "${workspaceFolder}/build/tests/unit_tests",
"options": {
"cwd": "${workspaceFolder}/build/tests"
},
"group": {
"kind": "test",
"isDefault": true
},
"problemMatcher": [],
"presentation": {
"reveal": "always",
"panel": "shared"
}
},
{
"label": "Run amalgamate script",
"type": "shell",
"command": "python3",
"args": [
"third_party/amalgamate/amalgamate.py",
"-c",
"third_party/amalgamate/config.json",
"-s",
"."
],
"group": {
"kind": "build",
"isDefault": false
},
"problemMatcher": [],
"presentation": {
"reveal": "always",
"panel": "shared"
}
},
{
"label": "Run clang-format",
"type": "shell",
"command": "clang-format",
"args": [
"-i",
"-style=file",
"include/sqlite_orm/*.h",
"tests/*.cpp",
"tests/*/*.cpp",
"tests/*/*/*.cpp",
"dev/*.h",
"dev/*/*.h",
"tests/*/*.h",
"examples/*.cpp",
"examples/*/src/*.cpp"
],
"group": {
"kind": "build",
"isDefault": false
},
"problemMatcher": [],
"presentation": {
"reveal": "always",
"panel": "shared"
}
}
]
}
6 changes: 3 additions & 3 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ for:
install:
- |-
cd C:\Tools\vcpkg
git fetch --tags && git checkout 2024.06.15
git fetch --tags && git checkout 2024.07.12
cd %APPVEYOR_BUILD_FOLDER%
C:\Tools\vcpkg\bootstrap-vcpkg.bat -disableMetrics
C:\Tools\vcpkg\vcpkg integrate install
Expand Down Expand Up @@ -141,7 +141,7 @@ for:
install:
- |-
pushd $HOME/vcpkg
git fetch --tags && git checkout 2024.06.15
git fetch --tags && git checkout 2024.07.12
popd
$HOME/vcpkg/bootstrap-vcpkg.sh -disableMetrics
$HOME/vcpkg/vcpkg integrate install --overlay-triplets=vcpkg/triplets
Expand Down Expand Up @@ -169,7 +169,7 @@ for:
# using custom vcpkg triplets for building and linking dynamic dependent libraries
install:
- |-
git clone --depth 1 --branch 2024.06.15 https://github.com/microsoft/vcpkg.git $HOME/vcpkg
git clone --depth 1 --branch 2024.07.12 https://github.com/microsoft/vcpkg.git $HOME/vcpkg
$HOME/vcpkg/bootstrap-vcpkg.sh -disableMetrics
$HOME/vcpkg/vcpkg integrate install --overlay-triplets=vcpkg/triplets
vcpkg install sqlite3[core,dbstat,math,json1,fts5,soundex] catch2 --overlay-triplets=vcpkg/triplets
Expand Down
4 changes: 2 additions & 2 deletions dev/alias.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include <type_traits> // std::enable_if, std::is_same, std::conditional
#include <type_traits> // std::enable_if, std::is_same
#include <utility> // std::make_index_sequence, std::move
#include <string> // std::string
#include <sstream> // std::stringstream
Expand Down Expand Up @@ -291,7 +291,7 @@ namespace sqlite_orm {
polyfill::conjunction_v<internal::is_table_alias<A>, internal::is_cte_moniker<internal::type_t<A>>>,
bool> = true>
constexpr auto alias_column(C c) {
using namespace internal;
using namespace ::sqlite_orm::internal;
using cte_moniker_t = type_t<A>;

if constexpr(is_column_pointer_v<C>) {
Expand Down
1 change: 0 additions & 1 deletion dev/alias_traits.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include <concepts>
#endif

#include "functional/cxx_universal.h"
#include "functional/cxx_type_traits_polyfill.h"
#include "type_traits.h"
#include "table_reference.h"
Expand Down
1 change: 1 addition & 0 deletions dev/arithmetic_tag.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#pragma once

#include <type_traits> // std::is_integral

#include "functional/mpl/conditional.h"
Expand Down
2 changes: 2 additions & 0 deletions dev/ast/match.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#pragma once

#include <utility> // std::move

namespace sqlite_orm {
namespace internal {

Expand Down
3 changes: 2 additions & 1 deletion dev/ast/set.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ namespace sqlite_orm {
void push_back(assign_t<L, R> assign) {
auto newContext = this->context;
newContext.skip_table_name = true;
iterate_ast(assign, this->collector);
// note: we are only interested in the table name on the left-hand side of the assignment operator expression
iterate_ast(assign.lhs, this->collector);
std::stringstream ss;
ss << serialize(assign.lhs, newContext) << ' ' << assign.serialize() << ' '
<< serialize(assign.rhs, context);
Expand Down
5 changes: 2 additions & 3 deletions dev/ast/where.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#include <type_traits> // std::false_type, std::true_type
#include <utility> // std::move

#include "../functional/cxx_universal.h"
#include "../functional/cxx_type_traits_polyfill.h"
#include "../serialize_result_type.h"

Expand All @@ -27,7 +26,7 @@ namespace sqlite_orm {

expression_type expression;

where_t(expression_type expression_) : expression(std::move(expression_)) {}
constexpr where_t(expression_type expression_) : expression(std::move(expression_)) {}
};

template<class T>
Expand All @@ -47,7 +46,7 @@ namespace sqlite_orm {
* auto rows = storage.select(&Letter::name, where(greater_than(&Letter::id, 3)));
*/
template<class C>
internal::where_t<C> where(C expression) {
constexpr internal::where_t<C> where(C expression) {
return {std::move(expression)};
}
}
1 change: 0 additions & 1 deletion dev/collate_argument.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@ namespace sqlite_orm {
rtrim,
};
}

}
6 changes: 5 additions & 1 deletion dev/column_result.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#include <type_traits> // std::enable_if, std::is_same, std::decay, std::is_arithmetic, std::is_base_of
#include <functional> // std::reference_wrapper

#include "functional/cxx_universal.h" // ::nullptr_t
#include "functional/cxx_type_traits_polyfill.h"
#include "functional/mpl.h"
#include "tuple_helper/tuple_traits.h"
Expand Down Expand Up @@ -150,6 +149,11 @@ namespace sqlite_orm {
using type = std::string;
};

template<class DBOs, class T>
struct column_result_t<DBOs, unary_minus_t<T>, void> {
using type = double;
};

template<class DBOs, class L, class R>
struct column_result_t<DBOs, add_t<L, R>, void> {
using type = double;
Expand Down
Loading
Loading