Optimize a few queries

This commit is contained in:
Scott Nonnenberg 2021-12-20 13:04:02 -08:00 committed by GitHub
parent b08691b35b
commit 60a53656af
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
27 changed files with 1288 additions and 186 deletions

View file

@ -28,6 +28,7 @@ describe('sql/stories', () => {
const now = Date.now();
const conversationId = getUuid();
const sourceUuid = getUuid();
const ourUuid = getUuid();
const story1: MessageAttributesType = {
id: getUuid(),
@ -82,6 +83,7 @@ describe('sql/stories', () => {
await saveMessages([story1, story2, story3, story4, story5], {
forceSave: true,
ourUuid,
});
assert.lengthOf(await _getAllMessages(), 5);
@ -149,6 +151,8 @@ describe('sql/stories', () => {
const start = Date.now();
const conversationId = getUuid();
const ourUuid = getUuid();
const story1: MessageAttributesType = {
id: getUuid(),
body: 'message 1',
@ -197,6 +201,7 @@ describe('sql/stories', () => {
await saveMessages([story1, story2, story3, story4, story5], {
forceSave: true,
ourUuid,
});
assert.lengthOf(await _getAllMessages(), 5);