AnnZhimol
49e327005e
+ch_experiment_data in click_house +experiment_data and experiment_parameters in postgresql +experiment_data has foreign_key from experiment_parameters +new connections +realize routes for ch_experiment_data +new alg csv_to_db +new methods in repos +update dockerfile +update readme "how to init db"
27 lines
1.0 KiB
Python
27 lines
1.0 KiB
Python
from clickhouse_sqlalchemy import engines
|
|
from clickhouse_sqlalchemy.types import Float64, String
|
|
from sqlalchemy import Integer
|
|
from sqlalchemy.orm import Mapped, mapped_column
|
|
|
|
from db.clickhouse_db_connection import BaseClickhouse
|
|
|
|
class ChExperimentDBExperimentData(BaseClickhouse):
|
|
__tablename__ = 'experiment_data'
|
|
__table_args__ = (
|
|
engines.MergeTree(order_by='id'),
|
|
)
|
|
|
|
id: Mapped[int] = mapped_column(Integer, primary_key=True, autoincrement=True)
|
|
volume: Mapped[float] = mapped_column(Float64)
|
|
nitrogen_oxide_emission: Mapped[float] = mapped_column(Float64)
|
|
temperature: Mapped[float] = mapped_column(Float64)
|
|
co_fraction: Mapped[float] = mapped_column(Float64)
|
|
co2_fraction: Mapped[float] = mapped_column(Float64)
|
|
x: Mapped[float] = mapped_column(Float64)
|
|
y: Mapped[float] = mapped_column(Float64)
|
|
z: Mapped[float] = mapped_column(Float64)
|
|
file_id: Mapped[str] = mapped_column(String)
|
|
|
|
def __repr__(self):
|
|
return f"<ChExperimentDBExperimentData id={self.id}, volume={self.volume}>"
|