Skip to content
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

fix: Find third party ids query #433

Merged
merged 5 commits into from
Mar 11, 2022

Conversation

LautaroPetaccio
Copy link
Contributor

This PR fixes an issue where we were using item instead of items when naming a table.
The aliases were removed, as the names of the collections are sufficient enough for this query and the table names were replaced by their table variable.

@coveralls
Copy link

coveralls commented Mar 11, 2022

Pull Request Test Coverage Report for Build 1970387670

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 67.957%

Totals Coverage Status
Change from base Build 1969497986: 0.0%
Covered Lines: 2271
Relevant Lines: 3194

💛 - Coveralls

WHERE collections.third_party_id = ANY(${thirdPartyIds})`)
SELECT ${itemsTable}.*
FROM ${itemsTable}
JOIN ${collectionsTable} ON collections.id = ${itemsTable}.collection_id
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing a ${collectionsTable} here right? (collections.id)

Question: it's a good idea to do this in general to avoid typos, but at the same time it makes the query really difficult to read. Can we strike a balance perhaps? shorter names but using the string in the query?

(we might need tests for queries heh)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ups, added it!
What makes me doubt is that we have the table name used as a variable for what I think is to avoid typos (or be reactive when the table changes), but we're only using it for the table once.

@@ -17,6 +17,7 @@ export function migrate(
}

const spawnArgs = [
'--no-check-order',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👀

@LautaroPetaccio LautaroPetaccio merged commit 7f51069 into master Mar 11, 2022
@LautaroPetaccio LautaroPetaccio deleted the fix/find-third-party-ids-query branch March 11, 2022 18:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants