[odb-users] SQLite not creating table?

Rafal Gm grasmanek94 at gmail.com
Fri Jul 5 04:13:41 EDT 2013


Ah indeed that section helped,

odb::transaction x (Database::users->begin ());
odb::schema_catalog::create_schema (*Database::users);
x.commit ();

solved the problem, thanks :)


2013/7/5 Rafal Gm <grasmanek94 at gmail.com>

> I preffer programmatically, but I don't see it anywhere in the examples?
> (except creating/executing SQL queries :( - not what I want)
>
>
> 2013/7/5 Boris Kolpackov <boris at codesynthesis.com>
>
>> Hi Rafal,
>>
>> Rafal Gm <grasmanek94 at gmail.com> writes:
>>
>> > Well after I switched from MySQL to SQlite at my surprise there was no
>> > generated .sql file to be used when the following command is issued:
>> >
>> > odb -d sqlite -I../Database/libodb-2.2.3 --std c++11 --generate-schema
>> > --generate-query "C:/path_to_file/classes/user.hxx"
>>
>> For SQLite, by default, the schema is embedded into the generated C++
>> code so that you can create the tables programmatically from within
>> your application (this is normally the preferred way when using an
>> embedded database like SQLite).
>>
>> If you still want the .sql file, then you can add the following option
>> to your ODB command line:
>>
>> --schema-format sql
>>
>> For more information on how to use embedded schemas, see Section 3.4,
>> "Database" in the ODB manual.
>>
>> Boris
>>
>
>


More information about the odb-users mailing list