0
0
mirror of https://github.com/rbock/sqlpp11.git synced 2024-11-15 20:31:16 +08:00

Fix require_insert generation in sqlite2cpp.py #569

This commit is contained in:
Roland Bock 2024-04-25 06:58:57 +02:00
parent ac9d0b4417
commit b92a9a7656

View File

@ -107,6 +107,7 @@ def main():
tableTemplateParameters += ',\n ' + tableNamespace + '::' + columnClass
columnMember = toMemberName(sqlColumnName)
sqlColumnType = column[2].lower()
sqlCanBeNull = column[3] == 0 or column[3] == '0'
print(' struct ' + columnClass, file=header)
print(' {', file=header)
print(' struct _alias_t', file=header)
@ -132,7 +133,7 @@ def main():
traitslist.append(NAMESPACE + '::tag::must_not_insert')
traitslist.append(NAMESPACE + '::tag::must_not_update')
requireInsert = False
if column[3] == '0':
if sqlCanBeNull:
traitslist.append(NAMESPACE + '::tag::can_be_null')
requireInsert = False
if column[4]: