plesna/plesna/models/storage.py

61 lines
1.4 KiB
Python
Raw Normal View History

2024-11-05 05:55:05 +00:00
from pydantic import BaseModel
class Schema(BaseModel):
"""Where multiple tables are stored
2024-11-05 05:55:05 +00:00
id: uniq identifier for the schema
repo_id: id of the repo where the schema belong to
name: name of the schema
value: string which describe where to find the schema in the repository
2024-11-05 05:55:05 +00:00
"""
id: str
repo_id: str
name: str
2024-11-05 05:55:05 +00:00
value: str
tables: list[str] = []
2024-11-05 05:55:05 +00:00
class Table(BaseModel):
"""Place where same structured data are stored
2024-11-05 05:55:05 +00:00
id: uniq identifier for the table
repo_id: id of the repo where the table belong to
schema_id: id of the schema where table belong to
name: the name of the table
2024-11-05 05:55:05 +00:00
value: string which describe where to find the table in the storage system
2025-01-04 20:33:05 +00:00
partitions: list of partitions
datas: list of string to access data
"""
id: str
repo_id: str
schema_id: str
name: str
value: str
partitions: list[str] = []
2025-01-04 20:33:05 +00:00
datas: list[str]
class Partition(BaseModel):
"""Place where data are stored
id: uniq identifier for the table
repo_id: id of the repo where the table belong to
schema_id: id of the schema where table belong to
table_id: id of the schema where table belong to
name: the name of the partition
value: string which describe where to find the partition in the storage system
2024-11-05 05:55:05 +00:00
"""
id: str
repo_id: str
schema_id: str
table_id: str
name: str
2024-11-05 05:55:05 +00:00
value: str