Is it possible to attach databases with wt::dbo and sqlite3 backend?
I've been trying to attach existing databases using wt::dbo, but it doesn't seem to work.
My system is Debian Wheezy, Wt 3.2.1, gcc 4.7.2 and sqlite 3.7.13 backend.
Sqlite supports the following: "attach database '/path/to/file/database' as my_test"
When I try this using execute() on a dbo session, it always reports: "SQL logic error or missing database".
Am I doing something wrong maybe?
Thank you for your help/advice!
Updated by Koen Deforche about 8 years ago
- Status changed from New to Feedback
I'm not sure if that is indeed possible as part of the SQL language supported in Sqlite, perhaps it's only something you can do in the SQlite executable which actually translates to Sqlite C API calls rather than SQL?
Updated by Koen Deforche almost 8 years ago
- Status changed from Feedback to Resolved
- Assignee set to Koen Deforche
- Target version set to 3.3.4
Reading the documentation, that should really work also from within the C API.
I also just tried this and I get the same problem as you for session.execute() (which needs to run within the context of a transaction), but the following does work (with sqlite3 being the Connection object itself):
sqlite3.executeSql("attach database 'test.db' as my_test");
Does that work for your use-case as a work-around?