Repository navigation
Conversation
Codecov Report
@@ Coverage Diff @@
## master #12568 +/- ##
==========================================
+ Coverage 90.13% 96.30% +6.17%
==========================================
Files 92 95 +3
Lines 9112 9256 +144
Branches 90 90
==========================================
+ Hits 8213 8914 +701
+ Misses 880 325 -555
+ Partials 19 17 -2
Continue to review full report at Codecov.
|
|
Any updates on this? It seems like a pretty simple merge |
|
It looks like one of the key maintainers on this project just left, so it might take the remaining team a minute to get to these. It looks like the PRs have been piling up for the last little bit. |
|
It would be great if someone could review this 😅 |
|
Hey there :) First of all: Thanks a bunch for your contribution to Sequelize! Much appreciated! A couple of months ago, we have switched from master to main branch as our primary development branch and hence this PR is now outdated :( If you still think this change is making sense, please consider recreating the PR against ✌️ |
|
Hi guys we also facing the same issue, any update on this? |
|
Feel free to open a new PR to include this, we would need additional tests. At least one for the normal behaviour that already works on @ephys you're working on schemas as part of #14999 so maybe you can give additional pointers or take it up yourself |
dorlanpabon
left a comment
There was a problem hiding this comment.
This change is appropriate and necessary to improve the accuracy and reliability of queries generated by Sequelize.
Prevents subquery errors: By adding the condition AND c.table_schema = st.schemaname, this ensures that the subquery returns results only from the correct schema, preventing the "more than one row returned by a subquery used as an expression" error, which occurs when there are tables with the same name in different schemas.
Clarity and accuracy: This change makes the query more precise by ensuring that the information is fetched from the correct schema, which is crucial in databases with multiple schemas or complex configurations.
Avoids unexpected behavior: Without this condition, the query could produce unpredictable results in environments with multiple schemas. Adding this check ensures more robust and reliable behavior
Pull Request check-list
Please make sure to review and check all of these items:
npm run testornpm run test-DIALECTpass with this change (including linting)?Description of change
If there is more than one schema with the same table names (e. g.:
publicandbackup), thepgd.descriptionsubquery indescribeTableQuerywill return more than one row and will result in the errorSequelizeDatabaseError: more than one row returned by a subquery used as an expression.The added condition prevents this from happening.