question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add "effected rows" count to update query

See original GitHub issue

Hi,

Thanks for lovely ORM. it would be nice if the update method return the number of the effected rows after update query

for example:

result = return await Users.filter(user_id=user_id).update(is_active=False)
# result value is None

to verify the update query succeeded i need to query the user again and retrieve the data

Thanks in advanced!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
AEnterprisecommented, Dec 23, 2019

works perfect, thanks a ton!

1reaction
grigicommented, Dec 23, 2019

Nope, the drivers all do something different. Remember DB-API covers sync, not async.

But it’s done 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Working with SQL Server ROWCOUNT
The rows affecting statement can be any INSERT, UPDATE, DELETE or SELECT statement that is executed directly before the @@ROWCOUNT execution ...
Read more >
sql - Return number of rows affected by UPDATE statements
INSERTED reflect the value after the UPDATE, INSERT, or MERGE statement is ... JUL 09' -- now get the count of affected records...
Read more >
number of rows affected - MSDN - Microsoft
In asp.net, when you call these operations using executenonquery() method, the return value of this method is the no of rows affected. In...
Read more >
How to use @@ROWCOUNT in SQL Server
The statement can be anything that affects rows: SELECT, INSERT, UPDATE, DELETE and so on. It's important that @@ROWCOUNT is called in the ......
Read more >
How can I getting total affected row in advanced "UPDATE" ...
Use Select @@RowCount and an Output parameter of data type int. Use an input parameter RowCount of data type text and set it...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found