client.py 513 B

123456789101112
  1. class BaseDatabaseClient:
  2. """Encapsulate backend-specific methods for opening a client shell."""
  3. # This should be a string representing the name of the executable
  4. # (e.g., "psql"). Subclasses must override this.
  5. executable_name = None
  6. def __init__(self, connection):
  7. # connection is an instance of BaseDatabaseWrapper.
  8. self.connection = connection
  9. def runshell(self):
  10. raise NotImplementedError('subclasses of BaseDatabaseClient must provide a runshell() method')