hiling_go/notes

46 lines
1.9 KiB
Plaintext
Raw Normal View History

2023-09-07 15:34:15 +07:00
################## SHOULD I SPLIT FOLLOW INTO 2 TABLES ?? ################################
we can put following and follower as 1 table instead of 2 table
(follower and following) but it's gonna be have multiple where clause when
querying instead, we can use less where clause query if we split it into two
tables, but idk how big is the performance difference is, so for right now
i'm just put it on single table, if the query speed diff noticeable we can
just remigrate it later
REF: - https://www.percona.com/blog/how-expensive-is-a-where-clause-in-mysql/
- https://stackoverflow.com/questions/58829268/does-using-where-clause-with-a-select-statement-increase-or-decrease-performance
##########################################################################################
######################### IMPLEMENT POLYMORPHIC RELATIONS ################################
ok idk how to implement polymorphic (without ORM ofc) because Rails have
the thing the polymorphic thing but imma just create a table with 1 column
"type" just polymorphic relation table so when i query it imma use "where"
clause.
ex: select message where commented_id = ... and where comment_type = (stories, ratings, locations)
##########################################################################################
####################### INDONESIA ADMINISTRATIVE DIVISION ################################
https://en.wikipedia.org/wiki/Provinces_of_Indonesia
2023-09-12 17:08:17 +07:00
##########################################################################################
######################### CUSTOM GIN VALIDATION ERR MESSAGE ##############################
make custom err message, and get all the type, the err message sucks now
https://github.com/gin-gonic/gin/issues/430 (using middleware)
tbh i'd raher use like a wrapper instead of middleware but we'll see
2023-09-07 15:34:15 +07:00
##########################################################################################