Closed isZumpo closed 2 months ago
The update involves refining the query mechanism in the DataStore
struct, specifically the GetClipsQualifyingForRemoval
method. A subquery is now strategically utilized as a table within the main query to enhance the selection process of clips for removal, aligning with the defined retention policy.
File Path | Change Summary |
---|---|
internal/.../interfaces.go |
Updated the GetClipsQualifyingForRemoval method in the DataStore struct to include a subquery used as a table in the main query for better targeting of clips based on retention policy. |
🐇✨ In the realm of code, where queries intertwine, A clever little update, oh so fine! Subqueries dance, in tables they weave, Finding old clips that we no longer need. Hop, skip, a jump! Clean-up's a delight, With smarter queries taking flight. 🚀 🐰💻
internal/datastore/interfaces.go (2)
`217-217`: Ensure the subquery alias is correctly referenced in the main query. The subquery is aliased as `n`, but it's not clear if this alias is consistently used in the joins and selections. Please verify that all references to fields in the subquery correctly use the `n` alias. --- `217-217`: The revised SQL query construction appears to align with the intended improvements. This change should correctly handle the integration of the subquery as a table, which is crucial for the functionality of identifying clips for removal. Good job on addressing the previous error effectively.
This commit removed a important n from the SQL statement. Causing unit tests etc to fail:
Since the original commit got merged quite quickly, so did a small hack I used to get in a AS n. This pull request fixes that hack by doing it the way gorm intended for it to be done.
Summary by CodeRabbit