Codegen now supports the database column type in the field template.

This allows for inserting it as a comment which is very useful while
tweaking your typemappings as you can see what the input was.
This commit is contained in:
eelke 2018-11-17 10:14:31 +01:00
parent be0064f730
commit 104ab5de1e
8 changed files with 49 additions and 19 deletions

View file

@ -36,20 +36,20 @@ protected:
TEST_F(TypeMappingsTest, defStringType)
{
QString result = tm.getTypeForOid(Pgsql::float4_oid);
QString result = tm.getTypeForOid(Pgsql::float4_oid).codeType();
ASSERT_EQ(result, def_str_type);
}
TEST_F(TypeMappingsTest, int4Type)
{
QString result = tm.getTypeForOid(Pgsql::int4_oid);
QString result = tm.getTypeForOid(Pgsql::int4_oid).codeType();
ASSERT_EQ(result, int4str);
}
TEST_F(TypeMappingsTest, int4overideType)
{
tm.set(Pgsql::int4_oid, "QString");
QString result = tm.getTypeForOid(Pgsql::int4_oid);
QString result = tm.getTypeForOid(Pgsql::int4_oid).codeType();
ASSERT_EQ(result, "QString");
}
@ -65,7 +65,7 @@ TEST_F(TypeMappingsTest, int4arrayType)
tm.setTypes(types);
QString result = tm.getTypeForOid(Pgsql::int4_array_oid);
QString result = tm.getTypeForOid(Pgsql::int4_array_oid).codeType();
ASSERT_EQ(result, "std::vector<int>");
}