Mercurial > repos > shellac > sam_consensus_v3
comparison env/lib/python3.9/site-packages/planemo/database/interface.py @ 0:4f3585e2f14b draft default tip
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
| author | shellac |
|---|---|
| date | Mon, 22 Mar 2021 18:12:50 +0000 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:4f3585e2f14b |
|---|---|
| 1 """Describe the interface classes of the planemo.database package.""" | |
| 2 | |
| 3 import abc | |
| 4 | |
| 5 from six import add_metaclass | |
| 6 | |
| 7 | |
| 8 @add_metaclass(abc.ABCMeta) | |
| 9 class DatabaseSource(object): | |
| 10 """Interface describing a source of profile databases.""" | |
| 11 | |
| 12 @abc.abstractmethod | |
| 13 def create_database(self, identifier): | |
| 14 """Create a database with specified short identifier. | |
| 15 | |
| 16 Throw an exception if it already exists. | |
| 17 """ | |
| 18 | |
| 19 @abc.abstractmethod | |
| 20 def delete_database(self, identifier): | |
| 21 """Delete a database with specified short identifier. | |
| 22 | |
| 23 Throw an exception if it already exists. | |
| 24 """ | |
| 25 | |
| 26 @abc.abstractmethod | |
| 27 def list_databases(self): | |
| 28 """Return identifiers associated with database source.""" | |
| 29 | |
| 30 @abc.abstractmethod | |
| 31 def sqlalchemy_url(self, identifier): | |
| 32 """Return a URL string for use by sqlalchemy.""" | |
| 33 | |
| 34 | |
| 35 __all__ = ( | |
| 36 "DatabaseSource", | |
| 37 ) |
