rsensor.database package

Submodules

rsensor.database.mqtt_to_db module

This module implements a python tool that transfers data from a MQTT broker to a database.

Usage:

mqtt_to_db.py [options]
Options:
-h, --help show this help message and exit
-H MQTT_HOST, --host=MQTT_HOST
 MQTT Hostname
-P MQTT_PORT, --port=MQTT_PORT
 MQTT portnumber (dfl: 1883)

rsensor.database.db module

rsensor.database.dbbase module

class rsensor.database.dbbase.DbBase(dbschema, forcetables, **kwargs)[source]

Bases: object

DbSchema = None

data structure that holds the schema of the DB

commit()[source]
create_tables(force=False)[source]

returns a list of SQL commands that creates all tables given in the schema

execute_script(fn)[source]
get_field_names()[source]

returns dicitionary of all tables and their fieldnames

get_tables()[source]
load_yaml_schema(ymlfn)[source]

load yaml file and store the schema in DbSchema

query(stmt)[source]
xquery(stmt)[source]

rsensor.database.dbmysql module

rsensor.database.dbsqlite module

rsensor.database.init_db module

Module contents