Skip to content

Commit

Permalink
Merge pull request #196 from fnc12/revert-193-fixed-templates
Browse files Browse the repository at this point in the history
Revert "Fixed templates"
  • Loading branch information
fnc12 authored Sep 15, 2018
2 parents 1e21747 + 23bf856 commit 8ee3d47
Show file tree
Hide file tree
Showing 29 changed files with 989 additions and 2,593 deletions.
10 changes: 2 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ script:
- clang -c sqlite-amalgamation-3190300/sqlite3.c -o sqlite.static
- clang++ -std=c++1y tests/tests.cpp sqlite.static -I include/ -I sqlite_amalgamation/ -ldl -lpthread -stdlib=libc++ -o tests.out
- ./tests.out
- clang++ -std=c++1y tests/tests.cpp sqlite.static -I include/ -I sqlite_amalgamation/ -ldl -lpthread -stdlib=libc++ -D SQLITE_ORM_OMITS_CODECVT -o tests_without_codecvt.out
- ./tests_without_codecvt.out
- clang++ -std=c++1y tests/static_tests.cpp sqlite.static -I include/ -I sqlite_amalgamation/ -ldl -lpthread -stdlib=libc++ -o static_tests.out
- ./static_tests.out
- clang++ -std=c++1y examples/core_functions.cpp sqlite.static -I include/ -I sqlite_amalgamation/ -ldl -lpthread -o a.out
Expand Down Expand Up @@ -51,6 +49,8 @@ script:
- ./a.out
- clang++ -std=c++1y examples/blob.cpp sqlite.static -I include/ -I sqlite_amalgamation/ -ldl -lpthread -o a.out
- ./a.out
- clang++ -std=c++1y examples/private_class_members.cpp sqlite.static -I include/ -I sqlite_amalgamation/ -ldl -lpthread -o a.out
- ./a.out
- clang++ -std=c++1y examples/foreign_key.cpp sqlite.static -I include/ -I sqlite_amalgamation/ -ldl -lpthread -o a.out
- ./a.out
- clang++ -std=c++1y examples/index.cpp sqlite.static -I include/ -I sqlite_amalgamation/ -ldl -lpthread -o a.out
Expand All @@ -69,9 +69,3 @@ script:
- ./a.out
- clang++ -std=c++1y examples/union.cpp sqlite.static -I include/ -I sqlite_amalgamation/ -ldl -lpthread -o a.out
- ./a.out
- clang++ -std=c++1y examples/subquery.cpp sqlite.static -I include/ -I sqlite_amalgamation/ -ldl -lpthread -o a.out
- ./a.out
- clang++ -std=c++1y examples/having.cpp sqlite.static -I include/ -I sqlite_amalgamation/ -ldl -lpthread -o a.out
- ./a.out
- clang++ -std=c++1y examples/exists.cpp sqlite.static -I include/ -I sqlite_amalgamation/ -ldl -lpthread -o a.out
- ./a.out
9 changes: 4 additions & 5 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,17 @@
* `FOREIGN KEY` - sync_schema fk comparison and ability of two tables to have fk to each other
* rest of core functions(https://sqlite.org/lang_corefunc.html)
* `CASE`
* `HAVING`
* `EXISTS`
* asterisk in raw select: `SELECT rowid, * FROM table`
* `ATTACH`
* blob incremental I/O https://sqlite.org/c3ref/blob_open.html
* reusing of prepared statements - useful for query optimisation
* explicit FROM for subqueries in FROM argument
* subselect
* backup API https://www.sqlite.org/backup.html
* busy handler https://sqlite.org/c3ref/busy_handler.html
* CAST https://sqlite.org/lang_expr.html#castexpr
* CREATE VIEW and other view operations https://sqlite.org/lang_createview.html
* triggers
* query static check for correct order (e.g. `GROUP BY` after `WHERE`)
* column alias
* `LEFT OUTER JOIN`
* triggers

Please feel free to add any feature that isn't listed here and not implemented yet.
14 changes: 1 addition & 13 deletions dev/aggregate_functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,7 @@ namespace sqlite_orm {
}
};

/**
* T is use to specify type explicitly for queries like
* SELECT COUNT(*) FROM table_name;
* T can be omitted with void.
*/
template<class T>
struct count_asterisk_t {
using type = T;

operator std::string() const {
return "COUNT";
Expand Down Expand Up @@ -104,12 +97,7 @@ namespace sqlite_orm {
return {t};
}

inline aggregate_functions::count_asterisk_t<void> count() {
return {};
}

template<class T>
aggregate_functions::count_asterisk_t<T> count() {
inline aggregate_functions::count_asterisk_t count() {
return {};
}

Expand Down
6 changes: 3 additions & 3 deletions dev/alias.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ namespace sqlite_orm {
};

template<class T, class SFINAE = void>
struct alias_extractor;
struct alias_exractor;

template<class T>
struct alias_extractor<T, typename std::enable_if<std::is_base_of<alias_tag, T>::value>::type> {
struct alias_exractor<T, typename std::enable_if<std::is_base_of<alias_tag, T>::value>::type> {
static std::string get() {
std::stringstream ss;
ss << T::get();
Expand All @@ -43,7 +43,7 @@ namespace sqlite_orm {
};

template<class T>
struct alias_extractor<T, typename std::enable_if<!std::is_base_of<alias_tag, T>::value>::type> {
struct alias_exractor<T, typename std::enable_if<!std::is_base_of<alias_tag, T>::value>::type> {
static std::string get() {
return {};
}
Expand Down
12 changes: 0 additions & 12 deletions dev/column.h
Original file line number Diff line number Diff line change
Expand Up @@ -176,48 +176,36 @@ namespace sqlite_orm {
struct getter_traits<getter_by_value_const<O, T>> {
using object_type = O;
using field_type = T;

static constexpr const bool returns_lvalue = false;
};

template<class O, class T>
struct getter_traits<getter_by_value<O, T>> {
using object_type = O;
using field_type = T;

static constexpr const bool returns_lvalue = false;
};

template<class O, class T>
struct getter_traits<getter_by_ref_const<O, T>> {
using object_type = O;
using field_type = T;

static constexpr const bool returns_lvalue = true;
};

template<class O, class T>
struct getter_traits<getter_by_ref<O, T>> {
using object_type = O;
using field_type = T;

static constexpr const bool returns_lvalue = true;
};

template<class O, class T>
struct getter_traits<getter_by_const_ref_const<O, T>> {
using object_type = O;
using field_type = T;

static constexpr const bool returns_lvalue = true;
};

template<class O, class T>
struct getter_traits<getter_by_const_ref<O, T>> {
using object_type = O;
using field_type = T;

static constexpr const bool returns_lvalue = true;
};

template<class T>
Expand Down
4 changes: 2 additions & 2 deletions dev/column_result.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ namespace sqlite_orm {
using type = int;
};

template<class T>
struct column_result_t<aggregate_functions::count_asterisk_t<T>, void> {
template<>
struct column_result_t<aggregate_functions::count_asterisk_t, void> {
using type = int;
};

Expand Down
Loading

0 comments on commit 8ee3d47

Please sign in to comment.