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

security: Add support for another column along with autoincrment column in where clause in update statement #430

Open
pritamlipu1 opened this issue Sep 9, 2021 · 0 comments

Comments

@pritamlipu1
Copy link

pritamlipu1 commented Sep 9, 2021

Currently when we update object/struct if it has autoincrement field, then unable to add 1 more column to where clause in update.
eg: Suppose we have multiple tenants having tenant_name column along with ID as an auto increment column.
When we update object, it uses only autoincrement ID field in where clause. What if we will change ID( of another tenant) and then update. Then it will update all fields of another tenant.
So If we have 1 more column support in where clause, then it will solve multi tenant issue.
eg: update table_name set .. ** where ID=123 AND tenant_name='tenant1'.**
Hope You got the problem.

table cols: ID, tenant_name, name, description,...
db.AddTableWithName(struct{}, "table_name").SetKeys(true, "id")

@pritamlipu1 pritamlipu1 changed the title security: Add another column support along with autoincrment column in where clause in update statement security: Add support for another column along with autoincrment column in where clause in update statement Sep 13, 2021
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

No branches or pull requests

1 participant