Skip to content

Instantly share code, notes, and snippets.

@anapaulagomes
Created July 6, 2018 09:52
Show Gist options
  • Save anapaulagomes/cfa0b4bdc650f78047cd1c1b8576189e to your computer and use it in GitHub Desktop.
Save anapaulagomes/cfa0b4bdc650f78047cd1c1b8576189e to your computer and use it in GitHub Desktop.
Scaffold for db helper
class DbWorker:
"""Doing the hard work on the DB."""
def __init__(self, queries):
self.queries = queries # old tables
def _connect(self, credentials):
# TODO here only db connection stuff - must return the cursor
# TODO must thrown an exception in error cases
pass
def _select_and_insert():
# TODO use self.cursor
pass
def do(self):
self.cursor = self._connect()
self._select_and_insert()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment