guardian
guardian copied to clipboard
Removing ORM and moving from Gorm to vanilla sql
Summary For some basic CRUD, ORM is helpful and help us faster in development. However, in our current state of Guardian, there are some cases when using gorm as an ORM will overcomplicate the query since we need more advanced query.
Proposed solution We can remove the ORM to get more flexibility to build a query and use query builder (goqu, squirrel, etc) instead to help it.
If later we decided to do this, I vote for working on https://github.com/odpf/guardian/issues/242 first before working on this issue, so that we can have more confidence on the tests after having big changes for this
@rahmatrhd +1 for that
based on our discussion, since the current PR for this issue adds more complexity to the code (scanning models with o2o, o2m, and m2m relationships can't be straightforward when not using gorm, a lot of custom raw query as a workaround to the previously mentioned issue) over improving readability, we will keep gorm for guardian, while still on improving some slow query/bad readability code/etc.