paulftw / hiberlite

C++ ORM for SQLite
BSD 3-Clause "New" or "Revised" License
714 stars 118 forks source link

Cannot call update() twice #32

Closed JoeyZhu1994 closed 6 years ago

JoeyZhu1994 commented 6 years ago

env: vs2017 15.5 branch: master code:

auto storage_employee = make_storage(m_File_Name, table_employee, table_student);
storage_employee.sync_schema();
storage_employee.begin_transaction();

for(some iteration for employee)
{
    if(...)
    {
         storage.update(...):
    }
}

for(some iteration for student)
{
    if(...)
    {
         storage.update(...):
    }
}

storage_student.commit();

if I wrote only one update(), it works ok, but compile error when existed two. visual studio showes that setColumnNames is not declared at line 4930. I'm a fresher to C++11, so I don't know if I used it correctly.

many thanks.

d-led commented 6 years ago

setColumnNames is not part of hiberlite. You probably have a C++ mistake somewhere. E.g. search for a missing include, where setColumnNames is defined. Compiler error messages can be confusing, and the mistake can sometimes lie somewhere else