shellbot.stores.sqlite module

class shellbot.stores.sqlite.SqliteStore(context=None, **kwargs)[source]

Bases: shellbot.stores.base.Store

Stores data for one space

This is a basic permanent key-value store.

Example:

store = SqliteStore(db='shellstore.db', id=space.id)
bond(id=None)[source]

Creates or uses a file to store data

Parameters:id (str) – the unique identifier of the related space
check()[source]

Checks configuration

get_db()[source]

Gets a handle on the database

on_init(prefix='sqlite', id=None, db=None, **kwargs)[source]

Adds processing to initialization

Parameters:
  • prefix (str) – the main keyword for configuration of this space
  • id (str) – the unique identifier of the related space (optional)
  • db (str) – name of the file that contains Sqlite data (optional)

Example:

store = SqliteStore(context=context, prefix='sqlite')

Here we create a new store powered by Sqlite, and use settings under the key sqlite in the context of this bot.