[odb-users] Declaring db connection in reading query

Nicholas Cremonesi nicholas.cremonesi at gmail.com
Mon Mar 9 07:35:33 EDT 2015


Thank you for your reply,

I thinked it was so..

so, in my case, how can I connect to the db whithout the create_database()
function?

2015-03-09 12:21 GMT+01:00 Boris Kolpackov <boris at codesynthesis.com>:

> Hi Nicholas,
>
> Nicholas Cremonesi <nicholas.cremonesi at gmail.com> writes:
>
> > I'm trying to execute queries on an already populated database. If I
> > declare the db connection like this "auto_ptr<database> db
> (create_database
> > (argc, argv));" I notice that, executing the query, the target table is
> > cleared.
>
> You copied the create_database() function from one of the examples.
> If you looked into its implementation, you would have seen that,
> for SQLite, it re-creates the database schema. This is the desired
> behavior for examples (we want them to start from the clean slate
> every time) but not necessarily for your application.
>
> Boris
>


More information about the odb-users mailing list