Add pickle storage#82
Conversation
|
Thanks for the PR @divanovGH. I've already played with the idea of adding a picke storage. In the end I decided against it, because allows arbitrary code execution. The docs write:
For that reason I'm uncomfortable putting including this in the TinyDB core. What do you think on that topic? |
|
I think that this solution can be used if the database is exclusively on the local machine. |
|
this storage should be used at user's own risk |
|
@msiemens note that, though pickle does allow for arbitrary code execution, we are only using the pickle module to store "trusted" data - and it is a suitable tool in that respect. So as long as you don't simply open a database downloaded from somewhere else using the pickle storage, you are safe. Side note: the pickle storage should ideally live as an extension module, and should it find life in a separate repository, may I ask you to put this, as big as possible at the top of the README,
|
This presumes that the file system is a "trusted" store and this isn't a really safe assumption. While I certainly don't expect that anyone would target a pickle file used by TinyDB, I don't feel good including this in the TinyDB core. I'd really prefer if this is an extension module. |
|
@divanovGH What do you think about releasing a pickle storage as an extension to TinyDB? |
|
@msiemens I completely agree with this |
|
Okay, I'll then close this PR and if someone creates a TinyDB extension providing a pickle storage I'll gladly link to it from the docs. |
Native objects (like datetime) serialize support