sqlite_micro_logger_arduino icon indicating copy to clipboard operation
sqlite_micro_logger_arduino copied to clipboard

In my DB table i have one colom isSynced can I edit it?

Open MarkEvens opened this issue 1 year ago • 1 comments

While saving I am saving the record with isSynced=0 and after the success response I want to modify it to isSynced=1 is it possible?

MarkEvens avatar Nov 27 '23 07:11 MarkEvens

Yes please use the update function to update column in record. This needs to be called with a read context after locating the record to be updated. Please note that the width of the column to be updated needs to be the same as when it was inserted.

// Updates value of column at current position
// For text and blob columns, pass the type to dblog_derive_data_len()
// to get the actual length
int dblog_upd_col_val(struct dblog_read_context *rctx, int col_idx, const void *val);

// Writes the current page to disk
// Typically called after updating values using dblog_upd_col_val()
int dblog_write_cur_page(struct dblog_read_context *rctx, write_fn_def write_fn);

siara-cc avatar Nov 29 '23 12:11 siara-cc