def _pragma_foreign_keys(connection, on):
 connection.execute(('PRAGMA foreign_keys=%s' % ('ON' if on else 'OFF')))

def _pragma_foreign_keys ( connection , on ) : connection . execute ( ( 'PRAGMA foreign_keys=%s' % ( 'ON' if on else 'OFF' ) ) )
sets the pragma foreign_keys state of the sqlite database .