[odb-users] SQlite ATTACH DATABASE + one minor issue
Boris Kolpackov
boris at codesynthesis.com
Mon Dec 17 09:40:14 EST 2012
Hi Alexander,
Alexander A. Prokhorov <prokher at gmail.com> writes:
> The first time I tries to use "view" feature with my sqlite db I've
> got the compilation error:
>
> view-result.hxx:27: error: expected class-name before `{' token
>
> looks like it cannot find result_impl_base . Including
>
> #include <odb/sqlite/result.hxx>
>
> into sqlite/view-result.hxx fixed the problem.
Yes, that's a bug that has been fixed for 2.2.0. If you would like
to get a version with the fix, you can use the 2.2.0.a2 pre-release
that we published recently. I've also applied the fix to the 2.1
branch in case we will decide to release 2.1.2 bug-fix (unlikely).
> The next thing I would like to ask is why executing (through
> odb::connection) SQL instruction
>
> ATTACH DATABASE '/path/dbfile' AS dst
>
> throws
>
> Exception: std::exception : 1: near "dst": syntax error
I suspected this was due to an old SQLite version and your follow up
confirmed it.
> Probably there is a better way to copy all the data from base to base,
> I would appreciate any advice here.
It looks like the SQLite Backup API was made for that:
http://www.sqlite.org/backup.html
Boris
More information about the odb-users
mailing list