readme/ddl2cpp KeyError handling

This commit is contained in:
“digitalist.ru”
2016-03-21 21:38:37 +03:00
parent 0f7244e295
commit b7b651e98b
2 changed files with 17 additions and 3 deletions

View File

@@ -181,7 +181,10 @@ for create in tableCreations:
print(' const T& operator()() const { return ' + columnMember + '; }', file=header)
print(' };', file=header)
print(' };', file=header)
traitslist = [NAMESPACE + '::' + types[sqlColumnType]];
try:
traitslist = [NAMESPACE + '::' + types[sqlColumnType]];
except KeyError as e:
print ('Error: datatype "' + sqlColumnType + '"" is not supported. Implement it (examples: sqlpp11/data_types) or raise an issue on github')
requireInsert = True
if column.hasAutoValue:
traitslist.append(NAMESPACE + '::tag::must_not_insert');