-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add support for older layer Objects #43
Comments
Weird use case, but yeah is surely possible. Any Pyrogram Object (both types and functions) can be serialized using the The only downside would be versioning. New layer updates could modify the types/functions schema and you won't be able to load old objects with the updated library. This can be handled by saving the layer number as well in your DB, but Pyrogram currently lacks support for older layers. |
I understand about versioning that makes sense. Thx much for your advice. Why do i use this approach? because i don't know clearly how to use lot of functions, types(i/ve been learning it) but i need to save accounts data now. Don't lost it. And in the future i'll extract info what i'm intrested in from objects |
All the latest functions and types are coming straight from the official Telegram clients schema, but they aren't documented at all. Fortunately, the names are descriptive enough to get an idea of what they do. Anyway, it turns out that this approach is actually used by the official Android app: it saves raw messages plus the layer number and loads them again when needed using the correct schema. I'll flag this as enhancement. Maybe we could add support for old layers someday, but for now this is a low priority. Thanks for the suggestion ^^ |
This is unlikely to happen. Closing for now. |
Now i examine the library functionality and have a need to store some objects in a DB.
So they are not similar and i wanna just dump them to bytes to store as is for further using.
For example:
Are there any pitfalls?
The text was updated successfully, but these errors were encountered: