On Wednesday, April 3, 2019 at 6:20:53 AM UTC+2, Shai Almog wrote: > > No. > We don't support byte buffers. Even if we did I'm talking about just using > a binary file which will always be faster than any sqlite implementation. > This will also allow reducing the database size which will make all queries > *much* faster. You are talking about JSON/XML which isn't what I'm saying. > I'm saying the SQL's blob column should just be a text column pointing at > a binary file on the device. >
A binary file with an index in the database would never be faster than storing the data directly into the database. Because for retreiving your data you would have first to request the database for the files indexes (=binary files names) and then to open the matching binary files to fetch the data (if you have 100 results, it means you would have to open and close 100 binary files...). And the size of the database does actually have no impact on the time of the queries. Only the number of stored objects does, not their size. An SQLite database is just an indexed binary file so requesting it is just as looking at the indexes (wich do not depend on the size of the objects stored) and then fetch the matching data from this file. Furthermore by keeping all the data in your database you reduce the risk of inconsistency in your data (with binary files and indexes into the DB the two might be out of sync) so as the number of files in your filesystem (because if I have thousands of objects to store it means I would have to keep thousands of different binary files...) As for supporting BLOB with iOS on CN1 you don't need to support byte buffers. You just have to pass all your arguments as a concatenated byte array to the native interface along with an int[2*number of args] array that describe the length and type (which can only be of two types: String or byte) of each argument in this concatenated data byte array. And on the native side, you deserialize this data by converting parts of this byte array that are String args to Strings and keep part that are byte args (= BLOB args) to byte. -- You received this message because you are subscribed to the Google Groups "CodenameOne Discussions" group. To unsubscribe from this group and stop receiving emails from it, send an email to codenameone-discussions+unsubscr...@googlegroups.com. Visit this group at https://groups.google.com/group/codenameone-discussions. To view this discussion on the web visit https://groups.google.com/d/msgid/codenameone-discussions/02eb1b84-440b-4b9b-98c3-1c10ad07d395%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.