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.

Cursor count attribute returns 0, when shouldn't

See original GitHub issue

For some reasons, when I try to check if request returns some data with the “count” attribute, the check fails because it always returns 0. Please, suggest. PS - this also worked in 2.X

>>> docs.select().execute()
<peewee.ModelObjectCursorWrapper object at 0x1089b80f0>
>>> docs.select().execute().count
0
>>> len(docs.select().execute())
308

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Karel-van-de-Plasschecommented, Feb 27, 2018

Suggestion: Maybe it can be renamed to _count to signify the private status?

0reactions
vikt0rscommented, Feb 27, 2018

Agreed, this wasn’t documented, sorry for my note

Read more comments on GitHub >

github_iconTop Results From Across the Web

Oracle / PLSQL: Cursor Attributes - TechOnTheNet
- Returns the number of rows fetched. - The ROWCOUNT attribute doesn't give the real row count until you have iterated through the...
Read more >
Cursor Attributes
A cursor attribute that can be appended to the name of a cursor or cursor variable. When a cursor is opened, %ROWCOUNT is...
Read more >
How to check if a result set is empty? - python - Stack Overflow
cursor.rowcount will usually be set to 0. If, however, you are running a statement that would never return a result set (such as...
Read more >
Cursor Object — cx_Oracle 8.2.0 documentation
This read-write attribute can be used to tune the number of rows internally fetched and buffered by internal calls to the database when...
Read more >
Cursors in Oracle PL/SQL | Oracle PLSQL concepts - YouTube
This video is to understand the concept of Oracle PL/SQL Cursors. Here we discuss implicit cursor, explicit cursor, difference between ...
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