Project

General

Profile

Actions

Support #3508

closed

Is it possible to attach databases with wt::dbo and sqlite3 backend?

Added by Anonymous over 9 years ago. Updated over 9 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Start date:
07/30/2014
Due date:
% Done:

0%

Estimated time:

Description

Hi,

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!

Wout

Actions #1

Updated by Koen Deforche over 9 years ago

  • Status changed from New to Feedback

Hey,

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?

Regards,

koen

Actions #2

Updated by Koen Deforche over 9 years ago

  • Status changed from Feedback to Resolved
  • Assignee set to Koen Deforche
  • Target version set to 3.3.4

Hey Wout,

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?

Regards,

koen

Actions #3

Updated by Koen Deforche over 9 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF