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

UPDATE query returns none #271

Open
abhijitgujar86 opened this issue Dec 7, 2020 · 1 comment
Open

UPDATE query returns none #271

abhijitgujar86 opened this issue Dec 7, 2020 · 1 comment

Comments

@abhijitgujar86
Copy link

@abhijitgujar86 abhijitgujar86 commented Dec 7, 2020

I am using raw SQL query to update the table

rows = await app.db.execute( query= query )

the rows in none

1 ) How will i know if the query is successful or not
2) how will i know that how many rows have been updated ?

@henriqueblang
Copy link

@henriqueblang henriqueblang commented Feb 2, 2021

Not sure if this is the best approach, but maybe you could add a RETURNING clause in your SQL query and call a fetch variation instead of execute.
If your query is unsuccessful, your result will be None; else, you'll be able to find out how many rows were affected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants