SQL Storage Adapter¶
- class chatterbot.storage.SQLStorageAdapter(**kwargs)[source]¶
The SQLStorageAdapter allows ChatterBot to store conversation data in any database supported by the SQL Alchemy ORM.
All parameters are optional, by default a sqlite database is used.
It will check if tables are present, if they are not, it will attempt to create the required tables.
- Parameters:
database_uri (str) – eg: sqlite:///database_test.sqlite3’, The database_uri can be specified to choose database driver.
- create(text, in_response_to=None, tags=None, search_text=None, search_in_response_to=None, **kwargs)[source]¶
Creates a new statement matching the keyword arguments specified. Returns the created statement.
- filter(**kwargs)[source]¶
Returns a list of objects from the database. The kwargs parameter can contain any number of attributes. Only objects which contain all listed attributes and in which all values match for all listed attributes will be returned.