-
Notifications
You must be signed in to change notification settings - Fork 3
Add total_records fields for players and federations endpoint #293
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
Conversation
df88d61 to
7cc08f7
Compare
modules/db/src/main/scala/Db.scala
Outdated
| postgres.use(_.execute(q)(f.argument)) | ||
|
|
||
| def countFederationsSummary: IO[Long] = | ||
| import skunk.implicits.* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it okay to introduce dependency on skunk here? Seems sql macros belongs to Sql object, but otherwise I just would import it on top of the Db object declaration
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah you're right, I was just lazy π. Moved sql stuff to Sql object.
7cc08f7 to
2959718
Compare
Masynchin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks cheesy for me ππ»
|
@lenguyenthanh this two queries instantiates two connections, rather than using one, is it acceptable? In case of no, it can be added new layer, which combines query functions of |
|
yeah, It would be ideal if it uses only one connection. Another think we could do to optimize this is cache the count query instead of executing it for every page. |
I don't see how this cache can be properly invalidated π€ |
We can use crawler to invalidate the cache π€ or just use some arbitrary ttl. |
Seems workable. My concern is about consistency, so TTL seems disastrous π |
yeah, if we're worry about consistency then ttl is tragic, we probably not too worry about it tho π. But using crawler to invalidate the cache is much better idea anyway. |
Fix #280