ez_database module¶
- class ez_database.Database(table_name, constructor, localdb='sqlite:///local/database/ez.db')[source]¶
Bases: object
The Database class is a template for giving access to the SQL database. Also other databases like MySQL could be used.
- add_entries(entries, **kwargs)[source]¶
Performance function. Does not avoid duplicates like add_entry. Can be useful for syncing. You can specify chunk_size to optimize performance.
- add_entry(entry, out=False)[source]¶
Add an entry without creating duplicates in self.table. Objects that change like users should use the update_entry function.
- get_entry(**kwargs)[source]¶
- Returns entry given keyword argument component=value. Example:
- table.get_entry(UID=‘123’)
- in_DB(**kwargs)[source]¶
- Returns boolean given keyword argument component=value. Example:
- table.in_DB(UID=‘123’)