Skip to content

Commit

Permalink
Fully remove DQS from SQL queries
Browse files Browse the repository at this point in the history
  • Loading branch information
indutny-signal committed Jan 19, 2023
1 parent ebfd7a5 commit 6ddb12c
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
"@indutny/sneequals": "3.2.0",
"@popperjs/core": "2.11.6",
"@react-spring/web": "9.5.5",
"@signalapp/better-sqlite3": "8.1.0",
"@signalapp/better-sqlite3": "8.1.1",
"@signalapp/libsignal-client": "0.21.1",
"@signalapp/ringrtc": "2.23.0",
"@types/fabric": "4.5.3",
Expand Down
2 changes: 1 addition & 1 deletion ts/sql/migrations/41-uuid-keys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ export default function updateToSchemaVersion41(

db.exec(
`
DELETE FROM items WHERE id = "identityKey" OR id = "registrationId";
DELETE FROM items WHERE id = 'identityKey' OR id = 'registrationId';
`
);
};
Expand Down
4 changes: 2 additions & 2 deletions ts/sql/migrations/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ function updateToSchemaVersion7(
number
) WHERE number IS NOT NULL;
INSERT INTO sessions(id, number, json)
SELECT "+" || id, number, json FROM sessions_old;
SELECT '+' || id, number, json FROM sessions_old;
DROP TABLE sessions_old;
`);

Expand Down Expand Up @@ -899,7 +899,7 @@ function updateToSchemaVersion20(
// Drop triggers
const triggers = db
.prepare<EmptyQuery>(
'SELECT * FROM sqlite_master WHERE type = "trigger" AND tbl_name = "messages"'
"SELECT * FROM sqlite_master WHERE type = 'trigger' AND tbl_name = 'messages'"
)
.all();

Expand Down
18 changes: 9 additions & 9 deletions ts/test-node/sql_migrations_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,7 @@ describe('SQL migrations test', () => {
updateToVersion(43);

const { members, json: convoJSON } = db
.prepare('SELECT members, json FROM conversations WHERE id = "c"')
.prepare("SELECT members, json FROM conversations WHERE id = 'c'")
.get();

assert.strictEqual(members, `${UUID_A} ${UUID_B}`);
Expand All @@ -742,7 +742,7 @@ describe('SQL migrations test', () => {
});

const { json: messageMJSON } = db
.prepare('SELECT json FROM messages WHERE id = "m"')
.prepare("SELECT json FROM messages WHERE id = 'm'")
.get();

assert.deepStrictEqual(JSON.parse(messageMJSON), {
Expand Down Expand Up @@ -770,7 +770,7 @@ describe('SQL migrations test', () => {
});

const { json: messageNJSON } = db
.prepare('SELECT json FROM messages WHERE id = "n"')
.prepare("SELECT json FROM messages WHERE id = 'n'")
.get();

assert.deepStrictEqual(JSON.parse(messageNJSON), {
Expand Down Expand Up @@ -800,7 +800,7 @@ describe('SQL migrations test', () => {
updateToVersion(43);

const { json: messageMJSON } = db
.prepare('SELECT json FROM messages WHERE id = "m"')
.prepare("SELECT json FROM messages WHERE id = 'm'")
.get();

assert.deepStrictEqual(JSON.parse(messageMJSON), {
Expand Down Expand Up @@ -2368,9 +2368,9 @@ describe('SQL migrations test', () => {
INSERT INTO sticker_packs
(id, key, lastUsed)
VALUES
("a", "key-1", 1),
("b", "key-2", 2),
("c", "key-3", 3);
('a', 'key-1', 1),
('b', 'key-2', 2),
('c', 'key-3', 3);
`
);

Expand Down Expand Up @@ -2401,8 +2401,8 @@ describe('SQL migrations test', () => {
.prepare(
`
SELECT COUNT(*) FROM sqlite_schema
WHERE type = "table"
AND name = "groupCallRings"
WHERE type = 'table'
AND name = 'groupCallRings'
`
)
.pluck();
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2154,10 +2154,10 @@
"@react-spring/shared" "~9.5.5"
"@react-spring/types" "~9.5.5"

"@signalapp/better-sqlite3@8.1.0":
version "8.1.0"
resolved "https://registry.yarnpkg.com/@signalapp/better-sqlite3/-/better-sqlite3-8.1.0.tgz#6ddbb759e4bbd572b343dc0e740836bb5c8edf0d"
integrity sha512-3KRDCfrlvoLYuCQ0MzcCtnzVaaivvejz6/XjCzV3tbECzH8SIc1PBASEMHSy4nAeqjY8MpETIwScW1613kFJiA==
"@signalapp/better-sqlite3@8.1.1":
version "8.1.1"
resolved "https://registry.yarnpkg.com/@signalapp/better-sqlite3/-/better-sqlite3-8.1.1.tgz#b39b9138bc79992d5e9707b246a67a1b88a18c49"
integrity sha512-k4njS/Vsr12Eow7G7TNBjJKSPU971DZQWGY4dfISdOBobAAiewstOwlqF3ZhpJznL6M3sri14MUM0iV1aZR15g==
dependencies:
bindings "^1.5.0"
tar "^6.1.0"
Expand Down

0 comments on commit 6ddb12c

Please sign in to comment.