Skip to content

Commit

Permalink
First attempt to offer sqlite_orm as a named C++ module
Browse files Browse the repository at this point in the history
  • Loading branch information
trueqbit committed Jul 16, 2024
1 parent 64342a0 commit 7e2f578
Show file tree
Hide file tree
Showing 66 changed files with 93 additions and 72 deletions.
2 changes: 1 addition & 1 deletion dev/alias.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include "tags.h"
#include "column_pointer.h"

namespace sqlite_orm {
_EXPORT_SQLITE_ORM namespace sqlite_orm {

namespace internal {
#ifdef SQLITE_ORM_WITH_CPP20_ALIASES
Expand Down
2 changes: 1 addition & 1 deletion dev/alias_traits.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "type_traits.h"
#include "table_reference.h"

namespace sqlite_orm {
_EXPORT_SQLITE_ORM namespace sqlite_orm {

/** @short Base class for a custom table alias, column alias or expression alias.
*/
Expand Down
2 changes: 1 addition & 1 deletion dev/arg_values.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#include "row_extractor.h"

namespace sqlite_orm {
_EXPORT_SQLITE_ORM namespace sqlite_orm {

/** @short Wrapper around a dynamically typed value object.
*/
Expand Down
2 changes: 1 addition & 1 deletion dev/arithmetic_tag.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include "functional/mpl/conditional.h"

namespace sqlite_orm {
_EXPORT_SQLITE_ORM namespace sqlite_orm {

/**
* Helper classes used by statement_binder and row_extractor.
Expand Down
2 changes: 1 addition & 1 deletion dev/ast/excluded.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include <utility> // std::move

namespace sqlite_orm {
_EXPORT_SQLITE_ORM namespace sqlite_orm {
namespace internal {

template<class T>
Expand Down
2 changes: 1 addition & 1 deletion dev/ast/exists.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#include "../tags.h"

namespace sqlite_orm {
_EXPORT_SQLITE_ORM namespace sqlite_orm {
namespace internal {

template<class T>
Expand Down
2 changes: 1 addition & 1 deletion dev/ast/group_by.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

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

namespace sqlite_orm {
_EXPORT_SQLITE_ORM namespace sqlite_orm {
namespace internal {

template<class T, class... Args>
Expand Down
2 changes: 1 addition & 1 deletion dev/ast/into.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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

namespace sqlite_orm {
_EXPORT_SQLITE_ORM namespace sqlite_orm {
namespace internal {

template<class T>
Expand Down
2 changes: 1 addition & 1 deletion dev/ast/match.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

namespace sqlite_orm {
_EXPORT_SQLITE_ORM namespace sqlite_orm {
namespace internal {

template<class T, class X>
Expand Down
2 changes: 1 addition & 1 deletion dev/ast/rank.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

namespace sqlite_orm {
_EXPORT_SQLITE_ORM namespace sqlite_orm {
namespace internal {
struct rank_t {};
}
Expand Down
2 changes: 1 addition & 1 deletion dev/ast/set.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "../tuple_helper/tuple_traits.h"
#include "../table_name_collector.h"

namespace sqlite_orm {
_EXPORT_SQLITE_ORM namespace sqlite_orm {

namespace internal {

Expand Down
2 changes: 1 addition & 1 deletion dev/ast/special_keywords.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

namespace sqlite_orm {
_EXPORT_SQLITE_ORM namespace sqlite_orm {
namespace internal {
struct current_time_t {};
struct current_date_t {};
Expand Down
2 changes: 1 addition & 1 deletion dev/ast/upsert_clause.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

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

namespace sqlite_orm {
_EXPORT_SQLITE_ORM namespace sqlite_orm {
namespace internal {
#if SQLITE_VERSION_NUMBER >= 3024000
template<class T, class A>
Expand Down
2 changes: 1 addition & 1 deletion dev/ast/where.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "../functional/cxx_type_traits_polyfill.h"
#include "../serialize_result_type.h"

namespace sqlite_orm {
_EXPORT_SQLITE_ORM namespace sqlite_orm {
namespace internal {

struct where_string {
Expand Down
2 changes: 1 addition & 1 deletion dev/ast_iterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include "ast/set.h"
#include "ast/match.h"

namespace sqlite_orm {
_EXPORT_SQLITE_ORM namespace sqlite_orm {

namespace internal {

Expand Down
2 changes: 1 addition & 1 deletion dev/backup.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "error_code.h"
#include "connection_holder.h"

namespace sqlite_orm {
_EXPORT_SQLITE_ORM namespace sqlite_orm {

namespace internal {

Expand Down
2 changes: 1 addition & 1 deletion dev/carray.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

#if SQLITE_VERSION_NUMBER >= 3020000
#ifdef SQLITE_ORM_INLINE_VARIABLES_SUPPORTED
namespace sqlite_orm {
_EXPORT_SQLITE_ORM namespace sqlite_orm {

#ifdef SQLITE_ORM_WITH_CPP20_ALIASES
inline constexpr orm_pointer_type auto carray_pointer_tag = "carray"_pointer_type;
Expand Down
2 changes: 1 addition & 1 deletion dev/collate_argument.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

namespace sqlite_orm {
_EXPORT_SQLITE_ORM namespace sqlite_orm {

namespace internal {

Expand Down
2 changes: 1 addition & 1 deletion dev/column_pointer.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "alias_traits.h"
#include "tags.h"

namespace sqlite_orm {
_EXPORT_SQLITE_ORM namespace sqlite_orm {
namespace internal {
/**
* This class is used to store explicit mapped type T and its column descriptor (member pointer/getter/setter).
Expand Down
4 changes: 2 additions & 2 deletions dev/conditions.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include "type_printer.h"
#include "literal.h"

namespace sqlite_orm {
_EXPORT_SQLITE_ORM namespace sqlite_orm {

namespace internal {

Expand Down Expand Up @@ -844,7 +844,7 @@ namespace sqlite_orm {

// Intentionally place operators for types classified as arithmetic or general operator arguments in the internal namespace
// to facilitate ADL (Argument Dependent Lookup)
namespace internal {
_EXPORT_SQLITE_ORM namespace internal {
template<
class T,
std::enable_if_t<polyfill::disjunction<std::is_base_of<negatable_t, T>, is_operator_argument<T>>::value,
Expand Down
2 changes: 1 addition & 1 deletion dev/constraints.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include "table_type_of.h"
#include "type_printer.h"

namespace sqlite_orm {
_EXPORT_SQLITE_ORM namespace sqlite_orm {

namespace internal {

Expand Down
4 changes: 2 additions & 2 deletions dev/core_functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include "table_reference.h"
#include "ast/into.h"

namespace sqlite_orm {
_EXPORT_SQLITE_ORM namespace sqlite_orm {

using int64 = sqlite_int64;
using uint64 = sqlite_uint64;
Expand Down Expand Up @@ -2040,7 +2040,7 @@ namespace sqlite_orm {

// Intentionally place operators for types classified as arithmetic or general operator arguments in the internal namespace
// to facilitate ADL (Argument Dependent Lookup)
namespace internal {
_EXPORT_SQLITE_ORM namespace internal {
template<class L,
class R,
std::enable_if_t<polyfill::disjunction<std::is_base_of<arithmetic_t, L>,
Expand Down
2 changes: 1 addition & 1 deletion dev/cte_moniker.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include "alias.h"

#if(SQLITE_VERSION_NUMBER >= 3008003) && defined(SQLITE_ORM_WITH_CTE)
namespace sqlite_orm {
_EXPORT_SQLITE_ORM namespace sqlite_orm {

namespace internal {
/**
Expand Down
4 changes: 2 additions & 2 deletions dev/cte_storage.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,15 @@ namespace sqlite_orm {

// aliased column expressions, explicit or implicitly numbered
template<typename F, typename ColRef, satisfies_is_specialization_of<ColRef, alias_holder> = true>
static auto make_cte_column(std::string name, const ColRef& /*finalColRef*/) {
auto make_cte_column(std::string name, const ColRef& /*finalColRef*/) {
using object_type = aliased_field<type_t<ColRef>, F>;

return sqlite_orm::make_column<>(std::move(name), &object_type::field);
}

// F O::*
template<typename F, typename ColRef, satisfies<std::is_member_pointer, ColRef> = true>
static auto make_cte_column(std::string name, const ColRef& finalColRef) {
auto make_cte_column(std::string name, const ColRef& finalColRef) {
using object_type = table_type_of_t<ColRef>;
using column_type = column_t<ColRef, empty_setter>;

Expand Down
2 changes: 1 addition & 1 deletion dev/cte_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "tuple_helper/tuple_fy.h"

#if(SQLITE_VERSION_NUMBER >= 3008003) && defined(SQLITE_ORM_WITH_CTE)
namespace sqlite_orm {
_EXPORT_SQLITE_ORM namespace sqlite_orm {

namespace internal {

Expand Down
2 changes: 1 addition & 1 deletion dev/eponymous_vtabs/dbstat.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "../schema/column.h"
#include "../schema/table.h"

namespace sqlite_orm {
_EXPORT_SQLITE_ORM namespace sqlite_orm {
#ifdef SQLITE_ENABLE_DBSTAT_VTAB
struct dbstat {
std::string name;
Expand Down
4 changes: 2 additions & 2 deletions dev/error_code.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <sstream> // std::ostringstream
#include <type_traits>

namespace sqlite_orm {
_EXPORT_SQLITE_ORM namespace sqlite_orm {

/** @short Enables classifying sqlite error codes.
Expand Down Expand Up @@ -50,7 +50,7 @@ namespace std {
struct is_error_code_enum<::sqlite_orm::orm_error_code> : true_type {};
}

namespace sqlite_orm {
_EXPORT_SQLITE_ORM namespace sqlite_orm {

class orm_error_category : public std::error_category {
public:
Expand Down
2 changes: 1 addition & 1 deletion dev/expression.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "functional/cxx_type_traits_polyfill.h"
#include "tags.h"

namespace sqlite_orm {
_EXPORT_SQLITE_ORM namespace sqlite_orm {

namespace internal {

Expand Down
2 changes: 1 addition & 1 deletion dev/field_printer.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include "is_std_ptr.h"
#include "type_traits.h"

namespace sqlite_orm {
_EXPORT_SQLITE_ORM namespace sqlite_orm {

/**
* Is used to print members mapped to objects in storage_t::dump member function.
Expand Down
2 changes: 1 addition & 1 deletion dev/function.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include "type_traits.h"
#include "tags.h"

namespace sqlite_orm {
_EXPORT_SQLITE_ORM namespace sqlite_orm {

struct arg_values;

Expand Down
6 changes: 6 additions & 0 deletions dev/functional/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

#include "cxx_universal.h"

#ifdef _BUILD_SQLITE_ORM_MODULE
#define _EXPORT_SQLITE_ORM export
#else
#define _EXPORT_SQLITE_ORM
#endif

#if SQLITE_ORM_HAS_INCLUDE(<version>)
#include <version>
#endif
Expand Down
2 changes: 1 addition & 1 deletion dev/get_prepared_statement.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include "node_tuple.h"
#include "expression_object_type.h"

namespace sqlite_orm {
_EXPORT_SQLITE_ORM namespace sqlite_orm {

template<int N, class It, class L, class O>
auto& get(internal::prepared_statement_t<internal::insert_range_t<It, L, O>>& statement) {
Expand Down
2 changes: 1 addition & 1 deletion dev/indexed_column.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "functional/cxx_universal.h"
#include "ast/where.h"

namespace sqlite_orm {
_EXPORT_SQLITE_ORM namespace sqlite_orm {

namespace internal {

Expand Down
2 changes: 1 addition & 1 deletion dev/is_std_ptr.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include <type_traits>
#include <memory>

namespace sqlite_orm {
_EXPORT_SQLITE_ORM namespace sqlite_orm {

/**
* Specialization for optional type (std::shared_ptr / std::unique_ptr).
Expand Down
2 changes: 1 addition & 1 deletion dev/journal_mode.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#undef DELETE
#endif

namespace sqlite_orm {
_EXPORT_SQLITE_ORM namespace sqlite_orm {

/**
* Caps case because of:
Expand Down
2 changes: 1 addition & 1 deletion dev/limit_accessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#include "connection_holder.h"

namespace sqlite_orm {
_EXPORT_SQLITE_ORM namespace sqlite_orm {

namespace internal {

Expand Down
2 changes: 1 addition & 1 deletion dev/literal.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

namespace sqlite_orm {
_EXPORT_SQLITE_ORM namespace sqlite_orm {
namespace internal {

/*
Expand Down
2 changes: 1 addition & 1 deletion dev/member_traits/member_traits.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "../functional/cxx_universal.h"
#include "../functional/cxx_type_traits_polyfill.h"

namespace sqlite_orm {
_EXPORT_SQLITE_ORM namespace sqlite_orm {
namespace internal {
// SFINAE friendly trait to get a member object pointer's field type
template<class T>
Expand Down
2 changes: 1 addition & 1 deletion dev/object_from_column_builder.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "schema/column.h"
#include "storage_lookup.h"

namespace sqlite_orm {
_EXPORT_SQLITE_ORM namespace sqlite_orm {

namespace internal {

Expand Down
2 changes: 1 addition & 1 deletion dev/operators.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "tags.h"
#include "serialize_result_type.h"

namespace sqlite_orm {
_EXPORT_SQLITE_ORM namespace sqlite_orm {

namespace internal {

Expand Down
Loading

0 comments on commit 7e2f578

Please sign in to comment.