Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

データベース開発環境整備 #40

Closed
itutu-tienday opened this issue Jul 7, 2023 · 1 comment · Fixed by #52
Closed

データベース開発環境整備 #40

itutu-tienday opened this issue Jul 7, 2023 · 1 comment · Fixed by #52
Assignees
Labels

Comments

@itutu-tienday
Copy link
Collaborator

itutu-tienday commented Jul 7, 2023

対応内容

以下、データベース周りの開発環境整備を行う。

  • DB(MySQL)のDockerを追加し、docker-composeで起動するようにする
    • 起動に必要なconfig, Dockerfileなどのファイルはstudio/config/dbに配置する
  • MySQLはalembicでPythonによるmigrationを行う想定で構築する
  • PythonでDBを扱う際には直接のSQLではなく、SQLALchemyなどのO/R mapperを使用する
    • O/R mapperのschemasはstudio/app/common/modelsにテーブルごとのファイルで定義する

まずは、backendからDBへのO/R mapperでのクエリが実行できる状態まで進めたらレビューさせてください。
(さらに細かい頻度でのレビューもOKです)
想定と合っていない場合の修正の時間を短くしたいので、レビュー時点ではusersテーブルだけで良いです。

@reactplus-thom
Copy link
Collaborator

reactplus-thom commented Jul 7, 2023

Thực hiện sắp xếp lại phần môi trường phát triển liên quan đến DB.

  • Thêm DB(MySQL) Docker để khởi động bằng docker-compose
    -> Các file config, dockerfile cần cho khởi động thì sẽ để ở studio/config/db
  • Build MySQL bằng cách thực hiện migration trên Python bằng alembic
  • Khi thao tác với DB bằng Python thì không sử dụng trực tiếp SQL mà sử dụng O/R mapper như SQLALchemy
    -> schemas của O/R mapper sẽ định nghĩa bằng file theo từng table ở studio/app/common/models

Trước tiên, nhờ các bạn tiến hành xử lý đến bước đưa về trạng thái để có thể chạy query bằng O/R mapper vào DB từ Backend => xong sau đó báo lại tôi để review cái đã. (Xong một lượt rồi gửi review cũng được, hoặc xong và gửi review từng bước cũng ok nhé)
Để rút ngắn thời gian trong trường hợp phải sửa lại do làm chưa đúng ý, thì quan điểm review ở đây chỉ là bảng users thôi.

@quanpython quanpython linked a pull request Jul 12, 2023 that will close this issue
ReiHashimoto pushed a commit that referenced this issue Sep 6, 2023
Snakemake configファイルの完全分離
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants