Skip to content

Commit

Permalink
Merge pull request #1195 from FireDaemon/concept_oriented_rowextractor
Browse files Browse the repository at this point in the history
Concept-oriented checks for "row extraction"
  • Loading branch information
trueqbit authored Jul 19, 2023
2 parents 22546ca + 98ea584 commit 5293beb
Show file tree
Hide file tree
Showing 20 changed files with 753 additions and 342 deletions.
6 changes: 3 additions & 3 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ for:
install:
- |-
cd C:\Tools\vcpkg
git fetch --tags && git checkout 2023.04.15
git fetch --tags && git checkout 2023.06.20
cd %APPVEYOR_BUILD_FOLDER%
C:\Tools\vcpkg\bootstrap-vcpkg.bat -disableMetrics
C:\Tools\vcpkg\vcpkg integrate install
Expand Down Expand Up @@ -140,7 +140,7 @@ for:
install:
- |-
pushd $HOME/vcpkg
git fetch --tags && git checkout 2023.04.15
git fetch --tags && git checkout 2023.06.20
popd
$HOME/vcpkg/bootstrap-vcpkg.sh -disableMetrics
$HOME/vcpkg/vcpkg integrate install --overlay-triplets=vcpkg/triplets
Expand Down Expand Up @@ -168,7 +168,7 @@ for:
# using custom vcpkg triplets for building and linking dynamic dependent libraries
install:
- |-
git clone --depth 1 --branch 2023.04.15 https://github.com/microsoft/vcpkg.git $HOME/vcpkg
git clone --depth 1 --branch 2023.06.20 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] catch2 --overlay-triplets=vcpkg/triplets
Expand Down
5 changes: 4 additions & 1 deletion dev/arg_values.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

namespace sqlite_orm {

/** @short Wrapper around a dynamically typed value object.
*/
struct arg_value {

arg_value() : arg_value(nullptr) {}
Expand All @@ -14,7 +16,8 @@ namespace sqlite_orm {

template<class T>
T get() const {
return row_extractor<T>().extract(this->value);
const auto rowExtractor = internal::boxed_value_extractor<T>();
return rowExtractor.extract(this->value);
}

bool is_null() const {
Expand Down
35 changes: 0 additions & 35 deletions dev/mapped_row_extractor.h

This file was deleted.

5 changes: 3 additions & 2 deletions dev/object_from_column_builder.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace sqlite_orm {
};

/**
* This is a cute lambda replacement which is used in several places.
* Function object for building an object from a result row.
*/
template<class O>
struct object_from_column_builder : object_from_column_builder_base {
Expand All @@ -33,7 +33,8 @@ namespace sqlite_orm {

template<class G, class S>
void operator()(const column_field<G, S>& column) {
auto value = row_extractor<member_field_type_t<G>>().extract(this->stmt, this->index++);
const auto rowExtractor = row_value_extractor<member_field_type_t<G>>();
auto value = rowExtractor.extract(this->stmt, this->index++);
static_if<std::is_member_object_pointer<G>::value>(
[&value, &object = this->object](const auto& column) {
object.*column.member_pointer = std::move(value);
Expand Down
5 changes: 3 additions & 2 deletions dev/pragma.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ namespace sqlite_orm {
inline int getPragmaCallback<std::vector<std::string>>(void* data, int argc, char** argv, char**) {
auto& res = *(std::vector<std::string>*)data;
res.reserve(argc);
for(decltype(argc) i = 0; i < argc; ++i) {
auto rowString = row_extractor<std::string>().extract(argv[i]);
const auto rowExtractor = column_text_extractor<std::string>();
for(int i = 0; i < argc; ++i) {
auto rowString = rowExtractor.extract(argv[i]);
res.push_back(std::move(rowString));
}
return 0;
Expand Down
Loading

0 comments on commit 5293beb

Please sign in to comment.