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

A version attr for tinydb - Enhancement #148

Closed
Phuket2 opened this Issue Aug 20, 2017 · 2 comments

Comments

2 participants
@Phuket2

Phuket2 commented Aug 20, 2017

It would be nice to have a version attr for tinydb. After my embarrassing mistake of running such an old version of tinydb, in the small app I am doing i wanted to do a version test on the lib. I still consider myself a beginner, so there may be other ways to do this that I am unaware of. But I have seen other Libs like SQLite for example have a version attr.
For backward compatibility we could use hasattr(db, 'version') before accessing it directly which if failed would tell us the maximum version it could be, if does not fail could then use the version attr.
Seems to me to this would be ok given, you typically would do this once at the star of your app.

@msiemens msiemens closed this in f1c3889 Aug 23, 2017

@msiemens

This comment has been minimized.

Show comment
Hide comment
@msiemens

msiemens Aug 23, 2017

Owner

That's a good idea! I'll release TinyDB v3.4.1 shortly which exposes the TinyDB version from the tinydb module like this:

import tinydb
print(tinydb.__version__)

# or

from tinydb import TinyDB, __version__ as tinydb_version
print(tinydb_version)
Owner

msiemens commented Aug 23, 2017

That's a good idea! I'll release TinyDB v3.4.1 shortly which exposes the TinyDB version from the tinydb module like this:

import tinydb
print(tinydb.__version__)

# or

from tinydb import TinyDB, __version__ as tinydb_version
print(tinydb_version)
@Phuket2

This comment has been minimized.

Show comment
Hide comment
@Phuket2

Phuket2 Aug 25, 2017

Perfect. Thanks. That will be useful for me, I hope others also

Phuket2 commented Aug 25, 2017

Perfect. Thanks. That will be useful for me, I hope others also

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