First of all, many thanks for the great solution Cloud KVS and I hope, this time this is a right place for this question.
For my projects, it is not the best solution to use the BLOB as data type to store. I would prefer to use String for stored values. As my objects are json, I could easly convert String data into json... Additionaly, I could 'see' this data from any SQLite viewer without making any "conversion script"
Is it possible to implement at the ClientKVS client (B4A) and CloudKVS_Server this String data instead of BLOB?
The simplest way is to modify the last step where the data is written to the server database.
This way you will not need to change the clients code at all.
You need to change
- value column type to TEXT
- Code to insert the data (DB module):
B4X:
Dim ser As B4XSerializator
sql.ExecNonQuery2("INSERT OR REPLACE INTO data VALUES (?, ?, ?, ?, ?)", _
Array (item.UserField, item.KeyField, ser.ConvertBytesToObject(item.ValueField), id, Min(item.TimeField, DateTime.Now)))
- Change this line to get a string from the database and serialize it to bytes with ser.ConvertObjectToBytes
OK, finally I wanted to replace the BLOB field (value) for the String (TEXT), in local db and server db to have the table with the same structure.
It is working!
So, if anyone has the similar goal (use String Field instead of BLOB), here go my client (B4A) and server (B4J) projects!
Best regards