plesna/plesna/storage/repository/repository.py

38 lines
902 B
Python

import abc
from plesna.models.storage import Partition, Schema, Table
class Repository:
def __init__(self, id: str, name: str):
self._id = id
self._name = name
@property
def id(self) -> str:
return self._id
@property
def name(self) -> str:
return self._name
@abc.abstractmethod
def schemas(self) -> list[str]:
"""List schema's ids"""
raise NotImplementedError
@abc.abstractmethod
def schema(self, schema_id: str) -> Schema:
"""Get the schema properties"""
raise NotImplementedError
@abc.abstractmethod
def tables(self, schema_id: str) -> list[str]:
"""List table's name in schema (the id)"""
raise NotImplementedError
@abc.abstractmethod
def table(self, table_id: str) -> Table:
"""Get the table properties (the id)"""
raise NotImplementedError