On 2014/11/21 08:09, Thane Michael wrote:
Many of the answers I came across online implied that it wouldn't be as straightforward as serializing ints and strings.
It would be equally difficult in any RDBMS, the difficulty does not lie with the Database, it lies with your objects. There are two general approaches for doing this with different advantages.
First and foremost is the method described by Clemens in another mail (so I won't dwell on the detail here), which is perfect for use in uncomplicated objects and which allows you to search the database and even build representations of entire objects just using some clever SQL (See: WITH RECURSIVE in the documentation). This is the method I would typically choose if my DB is intended to be a helpful search tool for objects as opposed to just storage.
Alternatively you can serialize anything object-like to XML or JSON and simply store the resulting string in the database. This allows you to not spend a lot on DB design and to use the same DB layout for any future changes to the base objects and save more since object-to-JSON etc. serializers are usually freely available and easy to code - but it takes away the ability to use fast SQL searches for specific properties etc. I say "fast" because it is still possible to search using SQL wildcards and the LIKE statement etc, but in general that is slower and much more cumbersome than being able to access/check a field directly.
Of course a byte-stream serializer is most speed-and-size happy and can easily be saved as a BLOB in any RDBMS (including SQLite) but the coding is usually painstaking and the DB is useless as a search-tool unless you employ some virtual tables to present data, and even then it will be slow-ish because of the VT decode step. This method should only ever be used if speed and/or space is absolutely paramount, otherwise go with the others.
All of this said - I can find no reason why any of the above methods should be any more or less difficult on any specific platform or RDBMS... I am not sure what those "online" help you found refers to or maybe we are not understanding the question well.
Good luck! _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users