Skip to content

Instantly share code, notes, and snippets.

@gabrielpetersson
Created August 18, 2022 21:17
Show Gist options
  • Save gabrielpetersson/a2f2d2e195f43b7a87b0bccf53c1fa1b to your computer and use it in GitHub Desktop.
Save gabrielpetersson/a2f2d2e195f43b7a87b0bccf53c1fa1b to your computer and use it in GitHub Desktop.
const rows: any = [];
for (let i = 0; i < 14; i++) {
const [key, ordinal] = await Promise.all([
extra.keyGenerator.nextKey(),
extra.ordinalGenerator.nextOrdinal(),
]);
rows.push({
key,
values: [{ kind: "string", value: ordinal }],
});
}
const insertRows: InsertRows = {
tableUuid,
columnMapping: [ordinalKeyColumnUuid],
rows,
};
const updateRows: UpdateRows = {
tableUuid,
columnMapping: ["e60526d2-c063-456c-b8a6-233b82eeb0c4" as Uuid],
rows: [{ key: rows[0]!.key, values: [{ kind: "string", value: "hey" }] }],
};
dispatch(searchSetIsOpen(false));
dispatch(stagedOpLogSlice.actions.insertRows(insertRows));
dispatch(stagedOpLogSlice.actions.updateRows(updateRows));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment