Use @signalapp/better-sqlite3

This commit is contained in:
Fedor Indutny 2022-12-14 12:48:36 -08:00 committed by GitHub
parent 076e3388a3
commit 50d9b6e5e1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
40 changed files with 97 additions and 88 deletions

View file

@ -61,6 +61,30 @@ Signal Desktop makes use of the following open source projects.
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
## @signalapp/better-sqlite3
The MIT License (MIT)
Copyright (c) 2017 Joshua Wise
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
## @sindresorhus/is
MIT License
@ -134,30 +158,6 @@ Signal Desktop makes use of the following open source projects.
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
## better-sqlite3
The MIT License (MIT)
Copyright (c) 2017 Joshua Wise
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
## bezier-easing
Copyright (c) 2014 Gaëtan Renaudeau

View file

@ -26,7 +26,7 @@ you can just run `nvm use` in the project directory and it will switch to the pr
desired Node.js version. [nvm for windows](https://github.com/coreybutler/nvm-windows) is
still useful, but it doesn't support `.nvmrc` files.
Then you need [`git`](https://git-scm.com/) and [`git-lfs`](https://github.com/git-lfs/git-lfs/wiki/Installation), if you don't have those yet.
Then you need [`git`](https://git-scm.com/), if you don't have it installed yet.
### macOS
@ -54,7 +54,6 @@ Install the [Xcode Command-Line Tools](http://osxdaily.com/2014/02/12/install-co
Now, run these commands in your preferred terminal in a good directory for development:
```
git lfs install # Setup Git LFS.
npm install --global yarn # Make sure you have have `yarn`
git clone https://github.com/signalapp/Signal-Desktop.git
cd Signal-Desktop
@ -78,12 +77,10 @@ the latest built assets when you change a file. Run each of these in their own t
instance while you make changes - they'll run until you stop them:
```
yarn transpile --watch # recompiles when you change .ts files
yarn sass-manifest --watch # recompiles when you change .scss files
yarn dev:transpile # recompiles when you change .ts files
yarn dev:sass # recompiles when you change .scss files
```
If you miss the `git-lfs` step, run `yarn cache clean` and remove `node_modules` before trying again.
### webpack
Some parts of the app (such as the Sticker Creator) have moved to webpack.

View file

@ -86,12 +86,12 @@
"@indutny/frameless-titlebar": "2.3.5",
"@popperjs/core": "2.11.6",
"@react-spring/web": "9.5.5",
"@signalapp/better-sqlite3": "8.0.3",
"@signalapp/libsignal-client": "0.21.1",
"@sindresorhus/is": "0.8.0",
"@types/fabric": "4.5.3",
"array-move": "2.1.0",
"backbone": "1.4.0",
"better-sqlite3": "https://github.com/signalapp/better-sqlite3#afdbd49cf18d0046d7385ca4d23da20c66f00d50",
"bezier-easing": "2.1.0",
"blob-util": "2.0.2",
"blueimp-load-image": "5.14.0",
@ -204,7 +204,6 @@
"@storybook/react": "6.5.6",
"@storybook/testing-library": "0.0.13",
"@types/backbone": "1.4.5",
"@types/better-sqlite3": "7.5.0",
"@types/blueimp-load-image": "5.14.1",
"@types/chai": "4.2.18",
"@types/chai-as-promised": "7.1.4",
@ -479,9 +478,9 @@
"node_modules/socks/build/common/*.js",
"node_modules/socks/build/client/*.js",
"node_modules/smart-buffer/build/*.js",
"!node_modules/better-sqlite3/deps/*",
"!node_modules/better-sqlite3/src/*",
"node_modules/better-sqlite3/build/Release/better_sqlite3.node",
"!node_modules/@signalapp/better-sqlite3/deps/*",
"!node_modules/@signalapp/better-sqlite3/src/*",
"node_modules/@signalapp/better-sqlite3/build/Release/better_sqlite3.node",
"node_modules/@signalapp/libsignal-client/prebuilds/${platform}-${arch}/*.node",
"node_modules/ringrtc/build/${platform}/*${arch}*.node",
"node_modules/mac-screen-capture-permissions/build/Release/*.node",

View file

@ -31,7 +31,7 @@ const bundleDefaults = {
// Native libraries
'@signalapp/libsignal-client',
'@signalapp/libsignal-client/zkgroup',
'better-sqlite3',
'@signalapp/better-sqlite3',
'electron',
'fs-xattr',
'fsevents',

View file

@ -7,8 +7,8 @@ import { mkdirSync } from 'fs';
import { join } from 'path';
import rimraf from 'rimraf';
import { randomBytes } from 'crypto';
import type { Database, Statement } from 'better-sqlite3';
import SQL from 'better-sqlite3';
import type { Database, Statement } from '@signalapp/better-sqlite3';
import SQL from '@signalapp/better-sqlite3';
import pProps from 'p-props';
import type { Dictionary } from 'lodash';

View file

@ -1,7 +1,7 @@
// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import type { Database } from 'better-sqlite3';
import type { Database } from '@signalapp/better-sqlite3';
import type { LoggerType } from '../../types/Logging';
import { isValidUuid } from '../../types/UUID';

View file

@ -1,7 +1,7 @@
// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import type { Database } from 'better-sqlite3';
import type { Database } from '@signalapp/better-sqlite3';
import { batchMultiVarQuery } from '../util';
import type { ArrayQuery } from '../util';

View file

@ -1,7 +1,7 @@
// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import type { Database } from 'better-sqlite3';
import type { Database } from '@signalapp/better-sqlite3';
import { omit } from 'lodash';
import type { LoggerType } from '../../types/Logging';

View file

@ -1,7 +1,7 @@
// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import type { Database } from 'better-sqlite3';
import type { Database } from '@signalapp/better-sqlite3';
import type { LoggerType } from '../../types/Logging';

View file

@ -1,7 +1,7 @@
// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import type { Database } from 'better-sqlite3';
import type { Database } from '@signalapp/better-sqlite3';
import type { LoggerType } from '../../types/Logging';

View file

@ -1,7 +1,7 @@
// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import type { Database } from 'better-sqlite3';
import type { Database } from '@signalapp/better-sqlite3';
import type { LoggerType } from '../../types/Logging';

View file

@ -1,7 +1,7 @@
// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import type { Database } from 'better-sqlite3';
import type { Database } from '@signalapp/better-sqlite3';
import type { LoggerType } from '../../types/Logging';
import { getOurUuid } from './41-uuid-keys';

View file

@ -1,7 +1,7 @@
// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import type { Database } from 'better-sqlite3';
import type { Database } from '@signalapp/better-sqlite3';
import type { LoggerType } from '../../types/Logging';

View file

@ -1,7 +1,7 @@
// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import type { Database } from 'better-sqlite3';
import type { Database } from '@signalapp/better-sqlite3';
import type { LoggerType } from '../../types/Logging';

View file

@ -1,7 +1,7 @@
// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import type { Database } from 'better-sqlite3';
import type { Database } from '@signalapp/better-sqlite3';
import type { LoggerType } from '../../types/Logging';

View file

@ -1,7 +1,7 @@
// Copyright 2022 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import type { Database } from 'better-sqlite3';
import type { Database } from '@signalapp/better-sqlite3';
import type { LoggerType } from '../../types/Logging';
import { isRecord } from '../../util/isRecord';

View file

@ -1,7 +1,7 @@
// Copyright 2022 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import type { Database } from 'better-sqlite3';
import type { Database } from '@signalapp/better-sqlite3';
import type { LoggerType } from '../../types/Logging';

View file

@ -1,7 +1,7 @@
// Copyright 2022 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import type { Database } from 'better-sqlite3';
import type { Database } from '@signalapp/better-sqlite3';
import type { LoggerType } from '../../types/Logging';
import type { UUIDStringType } from '../../types/UUID';

View file

@ -1,7 +1,7 @@
// Copyright 2022 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import type { Database } from 'better-sqlite3';
import type { Database } from '@signalapp/better-sqlite3';
import type { LoggerType } from '../../types/Logging';

View file

@ -1,7 +1,7 @@
// Copyright 2022 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import type { Database } from 'better-sqlite3';
import type { Database } from '@signalapp/better-sqlite3';
import type { LoggerType } from '../../types/Logging';
import { getJobsInQueueSync, insertJobSync } from '../Server';
import { isRecord } from '../../util/isRecord';

View file

@ -1,7 +1,7 @@
// Copyright 2021-2022 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import type { Database } from 'better-sqlite3';
import type { Database } from '@signalapp/better-sqlite3';
import { ReadStatus } from '../../messages/MessageReadStatus';
import { SeenStatus } from '../../MessageSeenStatus';

View file

@ -1,7 +1,7 @@
// Copyright 2022 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import type { Database } from 'better-sqlite3';
import type { Database } from '@signalapp/better-sqlite3';
import type { LoggerType } from '../../types/Logging';

View file

@ -1,7 +1,7 @@
// Copyright 2021-2022 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import type { Database } from 'better-sqlite3';
import type { Database } from '@signalapp/better-sqlite3';
import { ReadStatus } from '../../messages/MessageReadStatus';
import { SeenStatus } from '../../MessageSeenStatus';

View file

@ -1,7 +1,7 @@
// Copyright 2022 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import type { Database } from 'better-sqlite3';
import type { Database } from '@signalapp/better-sqlite3';
import type { LoggerType } from '../../types/Logging';

View file

@ -1,7 +1,7 @@
// Copyright 2021-2022 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import type { Database } from 'better-sqlite3';
import type { Database } from '@signalapp/better-sqlite3';
import type { LoggerType } from '../../types/Logging';

View file

@ -1,7 +1,7 @@
// Copyright 2022 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import type { Database } from 'better-sqlite3';
import type { Database } from '@signalapp/better-sqlite3';
import type { LoggerType } from '../../types/Logging';

View file

@ -1,7 +1,7 @@
// Copyright 2021-2022 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import type { Database } from 'better-sqlite3';
import type { Database } from '@signalapp/better-sqlite3';
import type { LoggerType } from '../../types/Logging';

View file

@ -1,7 +1,7 @@
// Copyright 2021-2022 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import type { Database } from 'better-sqlite3';
import type { Database } from '@signalapp/better-sqlite3';
import type { LoggerType } from '../../types/Logging';

View file

@ -1,7 +1,7 @@
// Copyright 2022 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import type { Database } from 'better-sqlite3';
import type { Database } from '@signalapp/better-sqlite3';
import type { LoggerType } from '../../types/Logging';

View file

@ -1,7 +1,7 @@
// Copyright 2021-2022 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import type { Database } from 'better-sqlite3';
import type { Database } from '@signalapp/better-sqlite3';
import type { LoggerType } from '../../types/Logging';

View file

@ -1,7 +1,7 @@
// Copyright 2022 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import type { Database } from 'better-sqlite3';
import type { Database } from '@signalapp/better-sqlite3';
import type { LoggerType } from '../../types/Logging';

View file

@ -1,7 +1,7 @@
// Copyright 2021-2022 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import type { Database } from 'better-sqlite3';
import type { Database } from '@signalapp/better-sqlite3';
import type { LoggerType } from '../../types/Logging';

View file

@ -1,7 +1,7 @@
// Copyright 2022 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import type { Database } from 'better-sqlite3';
import type { Database } from '@signalapp/better-sqlite3';
import type { LoggerType } from '../../types/Logging';

View file

@ -1,7 +1,7 @@
// Copyright 2022 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import type { Database } from 'better-sqlite3';
import type { Database } from '@signalapp/better-sqlite3';
import type { LoggerType } from '../../types/Logging';

View file

@ -1,7 +1,7 @@
// Copyright 2021-2022 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import type { Database } from 'better-sqlite3';
import type { Database } from '@signalapp/better-sqlite3';
import type { LoggerType } from '../../types/Logging';

View file

@ -1,7 +1,7 @@
// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import type { Database } from 'better-sqlite3';
import type { Database } from '@signalapp/better-sqlite3';
import type { LoggerType } from '../../types/Logging';

View file

@ -1,7 +1,7 @@
// Copyright 2021-2022 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import type { Database } from 'better-sqlite3';
import type { Database } from '@signalapp/better-sqlite3';
import { keyBy } from 'lodash';
import type { LoggerType } from '../../types/Logging';

View file

@ -1,7 +1,7 @@
// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import type { Database } from 'better-sqlite3';
import type { Database } from '@signalapp/better-sqlite3';
import { isNumber, last } from 'lodash';
export type EmptyQuery = [];

View file

@ -2,8 +2,8 @@
// SPDX-License-Identifier: AGPL-3.0-only
import { assert } from 'chai';
import type { Database } from 'better-sqlite3';
import SQL from 'better-sqlite3';
import type { Database } from '@signalapp/better-sqlite3';
import SQL from '@signalapp/better-sqlite3';
import { v4 as generateGuid } from 'uuid';
import { SCHEMA_VERSIONS } from '../sql/migrations';

View file

@ -2029,6 +2029,14 @@
"@react-spring/shared" "~9.5.5"
"@react-spring/types" "~9.5.5"
"@signalapp/better-sqlite3@8.0.3":
version "8.0.3"
resolved "https://registry.yarnpkg.com/@signalapp/better-sqlite3/-/better-sqlite3-8.0.3.tgz#c279ca3f1d1e7f6554d2a629d717e96e1ec45809"
integrity sha512-+WUWsyjKOrG55IGj43n7Q944jgTkUO8/wW9348nlkcy4RkEeQtHEvTKYD/JLVVG8Fdi01W9Ka1wwcoBY6d10bQ==
dependencies:
bindings "^1.5.0"
tar "^6.1.0"
"@signalapp/libsignal-client@0.21.1":
version "0.21.1"
resolved "https://registry.yarnpkg.com/@signalapp/libsignal-client/-/libsignal-client-0.21.1.tgz#381d6162ae0e7719dc625780c1d6c3f9f558c33d"
@ -3127,13 +3135,6 @@
"@types/jquery" "*"
"@types/underscore" "*"
"@types/better-sqlite3@7.5.0":
version "7.5.0"
resolved "https://registry.yarnpkg.com/@types/better-sqlite3/-/better-sqlite3-7.5.0.tgz#c57f42c76153d070f7673fbad0084ee324905be0"
integrity sha512-G9ZbMjydW2yj1AgiPlUtdgF3a1qNpLJLudc9ynJCeJByS3XFWpmT9LT+VSHrKHFbxb31CvtYwetLTOvG9zdxdg==
dependencies:
"@types/node" "*"
"@types/blueimp-load-image@5.14.1":
version "5.14.1"
resolved "https://registry.yarnpkg.com/@types/blueimp-load-image/-/blueimp-load-image-5.14.1.tgz#3963813699b574e757a140ed75a51050177ac780"
@ -5359,13 +5360,6 @@ better-opn@^2.1.1:
dependencies:
open "^7.0.3"
"better-sqlite3@https://github.com/signalapp/better-sqlite3#afdbd49cf18d0046d7385ca4d23da20c66f00d50":
version "7.5.1"
resolved "https://github.com/signalapp/better-sqlite3#afdbd49cf18d0046d7385ca4d23da20c66f00d50"
dependencies:
bindings "^1.5.0"
tar "^6.1.0"
bezier-easing@2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/bezier-easing/-/bezier-easing-2.1.0.tgz#c04dfe8b926d6ecaca1813d69ff179b7c2025d86"
@ -12427,6 +12421,13 @@ minipass@^3.1.1, minipass@^3.1.6:
dependencies:
yallist "^4.0.0"
minipass@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/minipass/-/minipass-4.0.0.tgz#7cebb0f9fa7d56f0c5b17853cbe28838a8dbbd3b"
integrity sha512-g2Uuh2jEKoht+zvO6vJqXmYpflPqzRBT+Th2h01DKh5z7wbY/AZ2gCQ78cP70YoHPyFdY30YBV5WxgLOEwOykw==
dependencies:
yallist "^4.0.0"
minizlib@^1.3.3:
version "1.3.3"
resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.3.3.tgz#2290de96818a34c29551c8a8d301216bd65a861d"
@ -16586,7 +16587,7 @@ tar@^4:
safe-buffer "^5.2.1"
yallist "^3.1.1"
tar@^6.0.2, tar@^6.1.0, tar@^6.1.11, tar@^6.1.2:
tar@^6.0.2, tar@^6.1.11, tar@^6.1.2:
version "6.1.11"
resolved "https://registry.yarnpkg.com/tar/-/tar-6.1.11.tgz#6760a38f003afa1b2ffd0ffe9e9abbd0eab3d621"
integrity sha512-an/KZQzQUkZCkuoAA64hM92X0Urb6VpRhAFllDzz44U2mcD5scmT3zBc4VgVpkugF580+DQn8eAFSyoQt0tznA==
@ -16598,6 +16599,18 @@ tar@^6.0.2, tar@^6.1.0, tar@^6.1.11, tar@^6.1.2:
mkdirp "^1.0.3"
yallist "^4.0.0"
tar@^6.1.0:
version "6.1.13"
resolved "https://registry.yarnpkg.com/tar/-/tar-6.1.13.tgz#46e22529000f612180601a6fe0680e7da508847b"
integrity sha512-jdIBIN6LTIe2jqzay/2vtYLlBHa3JF42ot3h1dW8Q0PaAG4v8rm0cvpVePtau5C6OKXGGcgO9q2AMNSWxiLqKw==
dependencies:
chownr "^2.0.0"
fs-minipass "^2.0.0"
minipass "^4.0.0"
minizlib "^2.1.1"
mkdirp "^1.0.3"
yallist "^4.0.0"
telejson@^6.0.8:
version "6.0.8"
resolved "https://registry.yarnpkg.com/telejson/-/telejson-6.0.8.tgz#1c432db7e7a9212c1fbd941c3e5174ec385148f7"