ChatterBot icon indicating copy to clipboard operation
ChatterBot copied to clipboard

[any]SQLConnection' object has no attribute 'execute'

Open ChristianTremblay opened this issue 5 years ago • 0 comments

This is related to issue #1272 which is now closed. I have a workaround that wanted to share.

To prevent this error message when using SQLite (default), I had to define the external database I wanted to reach in my logic before instanciating the chatbot.

It seems that once chatbot is alive, and using sqlite, no other connection to an external DB can be made.

from logic.mydatabaseprovider_request import session

provider_session = session
stock = provider_session .stock()

import chatter

**chatter is the module containing the chatbot and its creation, get_response, etc...

Not super elegant, but it works.

ChristianTremblay avatar Nov 23 '20 16:11 ChristianTremblay