mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-24 20:26:24 +00:00
Use @signalapp/sqlcipher
This commit is contained in:
@@ -6,7 +6,7 @@ import { v4 as generateGuid } from 'uuid';
|
||||
|
||||
import type { WritableDB, ReadableDB, MessageType } from '../../sql/Interface';
|
||||
import { sql, jsonToObject } from '../../sql/util';
|
||||
import { createDB, insertData, updateToVersion } from './helpers';
|
||||
import { createDB, insertData, updateToVersion, explain } from './helpers';
|
||||
|
||||
import type { MessageAttributesType } from '../../model-types';
|
||||
import { DurationInSeconds } from '../../util/durations/duration-in-seconds';
|
||||
@@ -43,7 +43,7 @@ export function getMostRecentAddressableNondisappearingMessages(
|
||||
LIMIT ${limit};
|
||||
`;
|
||||
|
||||
const rows = db.prepare(query).all(parameters);
|
||||
const rows = db.prepare(query).all<{ json: string }>(parameters);
|
||||
|
||||
return rows.map(row => jsonToObject(row.json));
|
||||
}
|
||||
@@ -159,10 +159,9 @@ describe('SQL/updateToSchemaVersion1080', () => {
|
||||
});
|
||||
|
||||
it('ensures that index is used for getMostRecentAddressableNondisappearingMessagesSync, with storyId', () => {
|
||||
const { detail } = db
|
||||
.prepare(
|
||||
`
|
||||
EXPLAIN QUERY PLAN
|
||||
const detail = explain(
|
||||
db,
|
||||
sql`
|
||||
SELECT json FROM messages
|
||||
INDEXED BY messages_by_date_addressable_nondisappearing
|
||||
WHERE
|
||||
@@ -172,8 +171,7 @@ describe('SQL/updateToSchemaVersion1080', () => {
|
||||
ORDER BY received_at DESC, sent_at DESC
|
||||
LIMIT 5;
|
||||
`
|
||||
)
|
||||
.get();
|
||||
);
|
||||
|
||||
assert.notInclude(detail, 'B-TREE');
|
||||
assert.notInclude(detail, 'SCAN');
|
||||
|
||||
Reference in New Issue
Block a user