[odb-users] Re: sqlite mismatch in result column count

MM finjulhich at gmail.com
Mon Sep 14 10:00:58 EDT 2015


On 14 September 2015 at 14:40, MM <finjulhich at gmail.com> wrote:

>
>
> On 14 September 2015 at 14:35, Boris Kolpackov <boris at codesynthesis.com>
> wrote:
>
>> Hi,
>>
>> MM <finjulhich at gmail.com> writes:
>>
>> > The 4rd column (the missing one) is of type std::string in the c++ class
>> > (B1), and of type TEXT in the db.
>>
>> You seem to be trying to map C++ classes to an existing schema. In this
>> case it is very helpful to still ask ODB to generate the schema and then
>> make sure that what gets generated is equivalent to the existing schema.
>>
>> For SQLite, use '--generate-schema --schema-format sql' to get the
>> schema as a standalone .sql file.
>>
>> Boris
>>
>
> Yes, I do that too.
> THe CREATE TABLE Statement does have 4 columns (3 INTEGER and 1 TEXT).
>
> Normally,
>
> #pragma odb (B1) abstract definition
>
> is equivalent to
>
> #pragma db object(B1) abstract definition
> #pragma db member(B1::field)
>
> with B1's base is abstract also, and F (derived from B) is not abstract
>
> ?
>
I just finished a long recompile because I had to add /usr/local/include to
test with the modified libodb...:-)

it now works.

I thought that as long as the entire B1 was not marked transient, all its
members would be considered, by non-abstract derived classes. This is:
    public std::string field

Adding
  #pragma db member(B1::field)
explicitly solved the problem

Rds,


More information about the odb-users mailing list