HomePhabricator
Diffusion Comm 585c20c0a367

[sqlite] implement C++ synced metadata store ops

Description

[sqlite] implement C++ synced metadata store ops

Summary:
Introduces code allowing native to use sqlite synced metadata store ops

Depends on D11417

Test Plan:
Ran the following code:

async function run_test() {
  console.log('running run_test()');

  await commCoreModule.processSyncedMetadataStoreOperations([
    {
      type: 'remove_all_synced_metadata',
    },
  ]);

  let data = await commCoreModule.getClientDBStore();
  console.log(data.syncedMetadata);

  await commCoreModule.processSyncedMetadataStoreOperations([
    {
      type: 'replace_synced_metadata_entry',
      payload: {
        name: 'test_B_name',
        data: 'test_B_data',
      },
    },
    {
      type: 'replace_synced_metadata_entry',
      payload: {
        name: 'test_A_name',
        data: 'test_A_data',
      },
    },
    {
      type: 'replace_synced_metadata_entry',
      payload: {
        name: 'test_A_name',
        data: 'test_A_update',
      },
    },
    {
      type: 'remove_synced_metadata',
      payload: { names: ['test_B_name'] },
    },
  ]);

  data = await commCoreModule.getClientDBStore();
  console.log(data.syncedMetadata);
}

And received the correct response of [{"data": "test_A_update", "name": "test_A_name"}]

Screenshot 2024-03-27 at 6.22.06 PM.png (768×846 px, 139 KB)

Reviewers: kamil, ginsu, atul

Reviewed By: kamil

Subscribers: ashoat, tomek

Differential Revision: https://phab.comm.dev/D11418

Details

Provenance
willAuthored on Mar 21 2024, 8:50 PM
Reviewer
kamil
Differential Revision
D11418: [sqlite] implement C++ synced metadata store ops
Parents
rCOMMf947cab385e0: [sqlite] add methods to operate on synced metadata table
Branches
Unknown
Tags
Unknown