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

Supabaseの管理クラスを作成 #65

Open
yukinkomob opened this issue Mar 25, 2023 · 7 comments
Open

Supabaseの管理クラスを作成 #65

yukinkomob opened this issue Mar 25, 2023 · 7 comments
Assignees

Comments

@yukinkomob
Copy link
Collaborator

No description provided.

@yukinkomob yukinkomob self-assigned this Mar 25, 2023
@yukinkomob
Copy link
Collaborator Author

yukinkomob commented Mar 25, 2023

とりあえず考えていること

  • repositoryパッケージを作成する
  • Repositoryクラスをそれぞれ作成し、データCRUD用の関数を作成し、再利用可能にする
  • インターフェースなどで切り分けせずに、共通化だけを目的としたクラスを作成する
  • とにかく手早く仕上げる

@yukinkomob yukinkomob linked a pull request Mar 25, 2023 that will close this issue
@yukinkomob
Copy link
Collaborator Author

yukinkomob commented Mar 25, 2023

今のところ、user, diaryテーブルに対する操作しか行われていない
他のテーブルに対するRepositoryは必要になった時に作成すれば良いので、今回は対応しない

@yukinkomob
Copy link
Collaborator Author

Supabase関連の操作は毎回実装の度に色々試したり、テストしたりが必要になるので、その辺りの保証もできないか

@yukinkomob
Copy link
Collaborator Author

テーブルに直接アクセスする形になっているとテストコードも書けない

@yukinkomob
Copy link
Collaborator Author

その辺りはまだノウハウがないので、とりあえずやれることをやっていく

@yukinkomob
Copy link
Collaborator Author

yukinkomob commented Mar 25, 2023

テスト用の画面を作成して、その中で各テーブルのCRUD処理を行えるようにする
それによって、手動でRepositoryのメソッドの品質を保証する形にする
テスト用のフラグを作成して、それをONにした場合、最初の画面で分岐させるようにする
フラグはenvで設定させるようにし、未設定の場合は通常の画面を表示する形にする

ex) IS_SUPABASE_TEST = true

@yukinkomob
Copy link
Collaborator Author

下記のAppServiceの実装が参考になりそう

AqNiyet/lib at main · igdmitrov/AqNiyet
https://github.com/igdmitrov/AqNiyet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant