0
0
mirror of https://github.com/rbock/sqlpp11.git synced 2024-11-15 20:31:16 +08:00

Minor code cleanup

This commit is contained in:
rbock 2014-01-28 18:03:14 +01:00
parent 687fe13055
commit 375dec25f8
10 changed files with 14 additions and 28 deletions

View File

@ -194,19 +194,6 @@ namespace sqlpp
struct has_duplicates
: std::integral_constant<bool, make_set<T...>::type::size::value != sizeof...(T)> {};
#if WANT_AUTO_JOIN
template<typename T>
struct begin // FIXME: Should move this into set struct
{
static_assert(wrong<T>::value, "begin template used on invalid type container");
};
template<typename T, typename... Rest>
struct begin<set<T, Rest...>>
{
using type = T;
};
#endif // WANT_AUTO_JOIN
}
}

View File

@ -145,7 +145,7 @@ namespace sqlpp
size_t _get_no_of_parameters() const
{
return _parameter_list_t::size::value; // FIXME: Need to add dynamic parameters here
return _parameter_list_t::size::value;
}
template<typename Db>

View File

@ -56,9 +56,6 @@ namespace sqlpp
static_assert(vendor::is_noop<Using>::value or is_using_t<Using>::value, "invalid 'Using' argument");
static_assert(vendor::is_noop<Where>::value or is_where_t<Where>::value, "invalid 'Where' argument");
// FIXME: We might want to have everywhere() or all() to indicate that everything is to be removed, same with update and select
template<typename UsingT>
using set_using_t = remove_t<Database, Table, UsingT, Where>;
template<typename WhereT>
@ -143,7 +140,7 @@ namespace sqlpp
size_t _get_no_of_parameters() const
{
return _parameter_list_t::size::value; // FIXME: Need to add dynamic parameters here
return _parameter_list_t::size::value;
}
template<typename Db>

View File

@ -605,12 +605,12 @@ namespace sqlpp
size_t _get_no_of_parameters() const
{
return _parameter_list_t::size::value; // FIXME: Need to add dynamic parameters here
return _parameter_list_t::size::value;
}
size_t get_no_of_result_columns() const
{
return _result_row_t::static_size(); // FIXME: Need to add the size of dynamic columns
return _result_row_t::static_size() + get_dynamic_names().size();
}
// Execute

View File

@ -27,12 +27,14 @@
#ifndef SQLPP_SELECT_FWD_H
#define SQLPP_SELECT_FWD_H
// FIXME: Do we really need this file?
#include <sqlpp11/vendor/noop_fwd.h>
#include <type_traits>
namespace sqlpp
{
namespace vendor
{
struct noop;
}
// select flags
struct all_t;
struct distinct_t;

View File

@ -85,7 +85,7 @@ namespace sqlpp
SQLPP_IS_VALUE_TRAIT_GENERATOR(expression);
SQLPP_IS_VALUE_TRAIT_GENERATOR(named_expression);
SQLPP_IS_VALUE_TRAIT_GENERATOR(multi_expression);
SQLPP_IS_VALUE_TRAIT_GENERATOR(alias); // FIXME: Is this really part of the value?
SQLPP_IS_VALUE_TRAIT_GENERATOR(alias);
SQLPP_IS_VALUE_TRAIT_GENERATOR(select_flag);
SQLPP_IS_COLUMN_TRAIT_GENERATOR(must_not_insert);

View File

@ -60,7 +60,6 @@ namespace sqlpp
using set_assignments_t = update_t<Database, Table, AssignmentsT, Where>;
template<typename WhereT>
using set_where_t = update_t<Database, Table, Assignments, WhereT>;
//FIXME: add method to explicitly indicate that EVERYTHING should be updated?
using _parameter_tuple_t = std::tuple<Table, Assignments, Where>;
using _parameter_list_t = typename make_parameter_list_t<update_t>::type;
@ -142,7 +141,7 @@ namespace sqlpp
size_t _get_no_of_parameters() const
{
return _parameter_list_t::size::value; // FIXME: Need to add dynamic parameters here
return _parameter_list_t::size::value;
}
template<typename Db>

View File

@ -55,7 +55,6 @@ namespace sqlpp
// FIXME: Joins contain two tables. This is not being dealt with at the moment when looking at duplicates, for instance
template<typename Table>
void add(Table&& table)
{

View File

@ -28,7 +28,6 @@
#define SQLPP_NOOP_H
#include <type_traits>
#include <sqlpp11/vendor/noop_fwd.h>
namespace sqlpp
{

View File

@ -83,7 +83,10 @@ namespace sqlpp
template<>
struct dynamic_select_column_list<void>
{
struct _names_t {};
struct _names_t
{
static constexpr size_t size() { return 0; }
};
_names_t _dynamic_expression_names;
template<typename T>