-
Notifications
You must be signed in to change notification settings - Fork 3
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
Support WHERE col IN (...) in context.db.table.select and delete #606
Conversation
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.
LGTM! Nice changes!
Let me check if the frontend allows for this too. |
Yeah it will not. Let me suggest the frontend fix to allow this... |
let tsTypeBase = columnDetails.type + " | " + columnDetails.type + "[]"; https://github.com/near/queryapi/blob/main/frontend/src/utils/pgSchemaTypeGen.js#L172 |
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.
Some small comments. Otherwise, it seems to work! I tried it out in the frontend and ran a simple indexer in the backend that does selects and deletes and observed the right behavior.
- feat: Instrument Runner Service (#602) - Support WHERE col IN (...) in context.db.table.select and delete (#606) - feat: Include indexer name in context db build failure warning (#611) - Cache provisioning status (#607) - Fix ESLint on DmlHandler (#612) - fix: Substitution 'node-sql-parser' with a forked version until Apri 1st (#597) - feat: Add pgBouncer to QueryApi (#615) - feat: Expose near-lake-primitives to VM (#613) --------- Co-authored-by: Pavel Kudinov <mrkroz@gmail.com> Co-authored-by: Pavel Kudinov <pavel@near.org> Co-authored-by: Kevin Zhang <42101107+Kevin101Zhang@users.noreply.github.com> Co-authored-by: Morgan McCauley <morgan@mccauley.co.nz>
With this PR, we can use
context.db.Table.select({column_name: ['a.near', 'b.near']})
. I think it is best to keep it within the same select method instead of introducing a new one likeselectMany
. The same support is added fordelete
.Frontend support is added. I also improved parameter naming to reflect SQL statements like
where
,values
andset
. Here is the sample output: