Closed AaronPorts closed 5 years ago
You can use setOption
with options beginning with 'x' or 'X' to persistently store some small amount of data. Values of these options will be sent in updateOption
on client launch along with values of all other options.
You can also use Chat.client_data
field and setChatClientData
method to store some per-chat data.
@levlam but is there any plan to implement interface in TDLib for implementing custom data storages? For example iOS apps use CoreData, for server side usage it could be useful to use PostgreSQL, MySQL or even NoSQL-databases.
@l11R No, there is no such plans, It's easily possible to replace SQLite database with any other SQL database and internal key-value databases with any other key-value database in the С++-code, but this change is unlikely to give any significant performance improvement.
@AaronPorts It seems that I've misunderstood your question. There is no need for TDLib to know about existence of IndexedDB to store data there, when TDLib is used from a browser. Emscripten suppots out of the box IDBFS, a file-system which will store all data persistently in the IndexedDB. We will publish soon complete example of TDLib usage from web browser, which will include example of IDBFS usage for persistent data storage.
@levlam Thanks for the answer. Looking forward to the example.
Can we use custom database (e.g. IndexedDB) to save user authorization data?