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

@ -18,11 +18,11 @@ std::shared_ptr<const TypeMappings> GetPglabCppTypeMappings(std::shared_ptr<con
{
{ bool_oid, "bool" },
{ char_oid, "char" },
{ name_oid, "std::string" },
{ name_oid, "QString" },
{ int8_oid, "int64_t" },
{ int2_oid, "int16_t" },
{ int4_oid, "int32_t" },
{ text_oid, "std::string" },
{ text_oid, "QString" },
{ oid_oid, "Oid" },
{ float4_oid, "float" },
{ float8_oid, "double" }
@ -43,7 +43,7 @@ public:
using /%structname%/Lst = std::vector</%structname%/>;
)__";
t->m_fieldTemplate = "/%typename%/ /%varname%/;";
t->m_fieldTemplate = "/%typename%/ /%varname%/; // /%dbtype%/";
//st_templ->m_fieldSeparator;
return t;