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

Make table and db iterable #139

Merged
merged 2 commits into from Jun 5, 2017

Conversation

3 participants
@noirbizarre
Contributor

noirbizarre commented May 26, 2017

This PR makes Table iterable and TinyDB iterable over default table so it's possible to write:

# Iter over default table
db = TinyDB()
for obj in db:
   do_something(obj)
table = db.table('my_table')
for obj in table:
   do_something(obj)
@msiemens

This comment has been minimized.

Show comment
Hide comment
@msiemens

msiemens May 30, 2017

Owner

I think that's a nice addition. I'm still thinking about where this should be described in the docs: basic usage or advanced usage.

@eugene-eeo What do you think about this change?

Owner

msiemens commented May 30, 2017

I think that's a nice addition. I'm still thinking about where this should be described in the docs: basic usage or advanced usage.

@eugene-eeo What do you think about this change?

@noirbizarre

This comment has been minimized.

Show comment
Hide comment
@noirbizarre

noirbizarre May 31, 2017

Contributor

I just added a simple documentation proposal

Contributor

noirbizarre commented May 31, 2017

I just added a simple documentation proposal

@eugene-eeo

This comment has been minimized.

Show comment
Hide comment
@eugene-eeo

eugene-eeo Jun 3, 2017

Contributor

@msiemens I'm fine with it since it opotimises for the 80% use case. But it needs to be documented somewhere. Perhaps in Basic Usage would be appropriate.

Contributor

eugene-eeo commented Jun 3, 2017

@msiemens I'm fine with it since it opotimises for the 80% use case. But it needs to be documented somewhere. Perhaps in Basic Usage would be appropriate.

@msiemens msiemens merged commit 8da0adb into msiemens:master Jun 5, 2017

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.003%) to 99.748%
Details
@msiemens

This comment has been minimized.

Show comment
Hide comment
@msiemens

msiemens Jun 5, 2017

Owner

since it opotimises for the 80% use case

Good point. I think it's quite intuitive for iter(db) to be an alias for db.all(). Thanks for the Pull Request @noirbizarre!

Owner

msiemens commented Jun 5, 2017

since it opotimises for the 80% use case

Good point. I think it's quite intuitive for iter(db) to be an alias for db.all(). Thanks for the Pull Request @noirbizarre!

@msiemens

This comment has been minimized.

Show comment
Hide comment
@msiemens

msiemens Jun 5, 2017

Owner

Also, I've now released TinyDB v3.3.0 which includes this feature :)

Owner

msiemens commented Jun 5, 2017

Also, I've now released TinyDB v3.3.0 which includes this feature :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment