mirror of
https://github.com/rbock/sqlpp11.git
synced 2026-01-06 05:00:37 -06:00
Fixed a bunch of small errors and shorted compile error messages
This commit is contained in:
@@ -19,5 +19,6 @@ find_package(PythonInterp REQUIRED)
|
||||
add_custom_command(
|
||||
OUTPUT ${CMAKE_CURRENT_LIST_DIR}/Sample.h
|
||||
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/scripts/ddl2cpp ${CMAKE_CURRENT_LIST_DIR}/sample.sql Sample test
|
||||
DEPENDS ${CMAKE_CURRENT_LIST_DIR}/sample.sql
|
||||
)
|
||||
|
||||
|
||||
@@ -62,8 +62,9 @@ int main()
|
||||
interpret(insert_into(t), printer).flush();
|
||||
interpret(insert_into(t).set(t.beta = "kirschauflauf"), printer).flush();
|
||||
interpret(insert_into(t).columns(t.beta), printer).flush();
|
||||
auto multi_insert = insert_into(t).columns(t.beta);
|
||||
multi_insert.add_values(t.beta = "cheesecake");
|
||||
auto multi_insert = insert_into(t).columns(t.beta, t.delta);
|
||||
multi_insert.add_values(t.beta = "cheesecake", t.delta = 1);
|
||||
multi_insert.add_values(t.beta = sqlpp::default_value, t.delta = sqlpp::default_value);
|
||||
auto i = dynamic_insert_into(db, t).dynamic_set();
|
||||
i.add_set(t.beta = "kirschauflauf");
|
||||
interpret(i, printer).flush();
|
||||
|
||||
@@ -273,7 +273,7 @@ int main()
|
||||
// Test that select(all_of(tab)) is expanded in select
|
||||
{
|
||||
auto a = select(all_of(t));
|
||||
auto b = select(t.alpha, t.beta, t.gamma);
|
||||
auto b = select(t.alpha, t.beta, t.gamma, t.delta);
|
||||
//auto c = select(t);
|
||||
static_assert(std::is_same<decltype(a), decltype(b)>::value, "all_of(t) has to be expanded by select()");
|
||||
//static_assert(std::is_same<decltype(b), decltype(c)>::value, "t has to be expanded by select()");
|
||||
@@ -282,14 +282,14 @@ int main()
|
||||
// Test that select(all_of(tab)) is expanded in multi_column
|
||||
{
|
||||
auto a = multi_column(alias::a, all_of(t));
|
||||
auto b = multi_column(alias::a, t.alpha, t.beta, t.gamma);
|
||||
auto b = multi_column(alias::a, t.alpha, t.beta, t.gamma, t.delta);
|
||||
static_assert(std::is_same<decltype(a), decltype(b)>::value, "all_of(t) has to be expanded by multi_column");
|
||||
}
|
||||
|
||||
// Test that select(tab) is expanded in multi_column
|
||||
{
|
||||
auto a = multi_column(alias::a, all_of(t));
|
||||
auto b = multi_column(alias::a, t.alpha, t.beta, t.gamma);
|
||||
auto b = multi_column(alias::a, t.alpha, t.beta, t.gamma, t.delta);
|
||||
static_assert(std::is_same<decltype(a), decltype(b)>::value, "t has to be expanded by multi_column");
|
||||
}
|
||||
|
||||
|
||||
@@ -35,6 +35,7 @@ CREATE TABLE tab_bar
|
||||
(
|
||||
alpha bigint AUTO_INCREMENT,
|
||||
beta varchar(255) NULL DEFAULT "",
|
||||
gamma bool NOT NULL
|
||||
gamma bool NOT NULL,
|
||||
delta int
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user