Please refer to general motivation in the upstream doc
Please see how it can decreses codes in message's Save and Select of this PR.
1-2. Feasibility
This PR contains the update of Post model with medddler. Thus, most probably it is possible to use meddler for other models. Just FYI, but Drone also uses meddler.
2. Update of Post structure
Post has Tags, User and Comment, so it always pads the data like this. This PR removes them from Post and implements them like this to from handler.
3. Move sql statments from sql_stmt.go into model codes
Thanks to the meddler, sql statements are not so long anymore. To improve readability, they are moved into their model codes. (e.g) post.go
This PR contains refactoring of
Message
andPost
model with:Post
model structuresql_stmt.go
topost.go
1. Introduction of meddler
1-1. Why meddler?
1-2. Feasibility
Post
model with medddler. Thus, most probably it is possible to use meddler for other models. Just FYI, but Drone also uses meddler.2. Update of Post structure
Post
hasTags
,User
andComment
, so it always pads the data like this. This PR removes them fromPost
and implements them like this to from handler.3. Move sql statments from
sql_stmt.go
into model codes