0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-03-31 22:51:25 -05:00

fix(deps): update dependency slonik to v30 (#1744)

* fix(deps): update dependency slonik to v30

* fix(core): await for `createPool()`

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Gao Sun <gao@silverhand.io>
This commit is contained in:
renovate[bot] 2022-08-12 09:27:54 +00:00 committed by GitHub
parent ba45466cf1
commit a9f99db54e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 46 additions and 18 deletions

View file

@ -68,7 +68,7 @@
"query-string": "^7.0.1",
"resolve-package-path": "^4.0.3",
"roarr": "^7.11.0",
"slonik": "^29.0.0",
"slonik": "^30.0.0",
"slonik-interceptor-preset": "^1.2.10",
"slonik-sql-tag-raw": "^1.1.4",
"snakecase-keys": "^5.1.0",

View file

@ -29,7 +29,7 @@ export const replaceDsnDatabase = (dsn: string, databaseName: string): string =>
* @returns DSN with the created database name.
*/
export const createDatabase = async (dsn: string, databaseName: string): Promise<string> => {
const pool = createPool(replaceDsnDatabase(dsn, 'postgres'));
const pool = await createPool(replaceDsnDatabase(dsn, 'postgres'));
await pool.query(sql`
create database ${sql.identifier([databaseName])}
@ -60,8 +60,8 @@ export const insertInto = <T extends SchemaLike>(object: T, table: string) => {
`;
};
export const createDatabaseCli = (dsn: string) => {
const pool = createPool(dsn, { interceptors: createInterceptors() });
export const createDatabaseCli = async (dsn: string) => {
const pool = await createPool(dsn, { interceptors: createInterceptors() });
const createTables = async () => {
const directory = await readdir(tableDirectory);

View file

@ -90,7 +90,7 @@ const createPoolByEnv = async (isTest: boolean) => {
try {
const databaseDsn = assertEnv(key);
return createPool(databaseDsn, { interceptors });
return await createPool(databaseDsn, { interceptors });
} catch (error: unknown) {
if (noInquiry) {
throw error;
@ -102,7 +102,7 @@ const createPoolByEnv = async (isTest: boolean) => {
throw error;
}
const cli = createDatabaseCli(dsn);
const cli = await createDatabaseCli(dsn);
if (needsSeed) {
await cli.createTables();

52
pnpm-lock.yaml generated
View file

@ -981,7 +981,7 @@ importers:
query-string: ^7.0.1
resolve-package-path: ^4.0.3
roarr: ^7.11.0
slonik: ^29.0.0
slonik: ^30.0.0
slonik-interceptor-preset: ^1.2.10
slonik-sql-tag-raw: ^1.1.4
snake-case: ^3.0.4
@ -1040,9 +1040,9 @@ importers:
query-string: 7.0.1
resolve-package-path: 4.0.3
roarr: 7.11.0
slonik: 29.0.0
slonik: 30.1.2
slonik-interceptor-preset: 1.2.10
slonik-sql-tag-raw: 1.1.4_roarr@7.11.0+slonik@29.0.0
slonik-sql-tag-raw: 1.1.4_roarr@7.11.0+slonik@30.1.2
snakecase-keys: 5.1.2
zod: 3.14.3
devDependencies:
@ -5969,7 +5969,7 @@ packages:
dev: false
/bufferput/0.1.3:
resolution: {integrity: sha1-xs1KLO+jldIod3She8mpCyJER9k=}
resolution: {integrity: sha512-nmPV88vDNzf0VMU1bdQ4A1oBlRR9y+CXfwWKfyKUgI2ZIkvreNzLMM3tkz0Lapb6f+Cz1V001UWRBsoGVCjqdw==}
engines: {node: '>=0.3.0'}
dev: false
@ -8876,7 +8876,7 @@ packages:
dev: false
/inherits/2.0.3:
resolution: {integrity: sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=}
resolution: {integrity: sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw==}
dev: false
/inherits/2.0.4:
@ -11476,7 +11476,7 @@ packages:
dev: true
/multi-fork/0.0.2:
resolution: {integrity: sha1-gFiuxGFBJMftqhWBm4juiJ0+tOA=}
resolution: {integrity: sha512-SHWGuze0cZNiH+JGJQFlB1k7kZLGFCvW1Xo5Fcpe86KICkC3aVTJWpjUcmyYcLCB0I6gdzKLCia/bTIw2ggl8A==}
dev: false
/multimatch/5.0.0:
@ -12511,6 +12511,19 @@ packages:
postgres-interval: 1.2.0
dev: false
/pg-types/4.0.0:
resolution: {integrity: sha512-q4I7zG+d2mDg52WdrOA0TmBvab9ZBC8DE8+opl3gSegnH5ml+0pKbICOfRKXgwQ5aa6NRjLoF5pEDs0YpGvFrw==}
engines: {node: '>=10'}
dependencies:
pg-int8: 1.0.1
pg-numeric: 1.0.2
postgres-array: 3.0.1
postgres-bytea: 3.0.0
postgres-date: 2.0.1
postgres-interval: 3.0.0
postgres-range: 1.1.2
dev: false
/pg/8.7.3:
resolution: {integrity: sha512-HPmH4GH4H3AOprDJOazoIcpI49XFsHCe8xlrjHkWiapdbHK+HLtbm/GQzXYAZwmPju/kzKhjaSfMACG+8cgJcw==}
engines: {node: '>= 8.0.0'}
@ -12759,6 +12772,11 @@ packages:
engines: {node: '>=0.10.0'}
dev: false
/postgres-date/2.0.1:
resolution: {integrity: sha512-YtMKdsDt5Ojv1wQRvUhnyDJNSr2dGIC96mQVKz7xufp07nfuFONzdaowrMHjlAzY6GDLd4f+LUHHAAM1h4MdUw==}
engines: {node: '>=12'}
dev: false
/postgres-interval/1.2.0:
resolution: {integrity: sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ==}
engines: {node: '>=0.10.0'}
@ -12771,11 +12789,20 @@ packages:
engines: {node: '>=8'}
dev: false
/postgres-interval/3.0.0:
resolution: {integrity: sha512-BSNDnbyZCXSxgA+1f5UU2GmwhoI0aU5yMxRGO8CdFEcY2BQF9xm/7MqKnYoM1nJDk8nONNWDk9WeSmePFhQdlw==}
engines: {node: '>=12'}
dev: false
/postgres-interval/4.0.0:
resolution: {integrity: sha512-OWeL7kyEKJiY7mCmVY+c7/6uhAlt/colA/Nl/Mgls/M3jssrQzFra04iNWnD/qAmG7TsCSgWAASCyiaoBOP/sg==}
engines: {node: '>=12'}
dev: false
/postgres-range/1.1.2:
resolution: {integrity: sha512-CmPJDSpd3/xYJrtw/tI0Cv029B0zMtnesUOHCZmgvypGBLn+eExXcjCS5OY7mpiw6imYEvd2IMD36sAOYA9U1w==}
dev: false
/posthtml-parser/0.10.2:
resolution: {integrity: sha512-PId6zZ/2lyJi9LiKfe+i2xv57oEjJgWbsHGGANwos5AvdQp98i6AtamAl8gzSVFGfQ43Glb5D614cvZf012VKg==}
engines: {node: '>=12'}
@ -13453,7 +13480,7 @@ packages:
dev: true
/readable-stream/1.0.34:
resolution: {integrity: sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=}
resolution: {integrity: sha512-ok1qVCJuRkNmvebYikljxJA/UEsKwLl2nI1OmaqAu4/UE+h0wKCHok4XkL/gvi39OacXvw59RJUOFUkDib2rHg==}
dependencies:
core-util-is: 1.0.3
inherits: 2.0.4
@ -14046,7 +14073,7 @@ packages:
- pg-native
dev: false
/slonik-sql-tag-raw/1.1.4_roarr@7.11.0+slonik@29.0.0:
/slonik-sql-tag-raw/1.1.4_roarr@7.11.0+slonik@30.1.2:
resolution: {integrity: sha512-os6iRAkQgKNoVzudRtLBlxjqmyQHJdPHw/eMIBJDnUfD5dle5uIyEKtblayW7eBr5x7blkzUg4BgvRkeDZeZPA==}
engines: {node: '>=10.0'}
peerDependencies:
@ -14056,7 +14083,7 @@ packages:
lodash: 4.17.21
roarr: 7.11.0
serialize-error: 8.1.0
slonik: 29.0.0
slonik: 30.1.2
dev: false
/slonik/22.7.1:
@ -14086,8 +14113,8 @@ packages:
- pg-native
dev: false
/slonik/29.0.0:
resolution: {integrity: sha512-jWVj0h9kSeywwzFtrTDaB+OS1TKlo5AesjoL53IUdy/bnhVP40HWk0dKvKuDWJdEH5cbK3/VeCZODNEUET8ycA==}
/slonik/30.1.2:
resolution: {integrity: sha512-vNCZT4eEr3cKnm83LF8QOCTfm3TH/XSQdMnG4X3A+V1PVJFG3JKjRMB8jwin/3eYeM6nVCSXeZqlPGlHHXrgBQ==}
engines: {node: '>=10.0'}
dependencies:
concat-stream: 2.0.0
@ -14103,6 +14130,7 @@ packages:
pg-copy-streams-binary: 2.2.0
pg-cursor: 2.7.3_pg@8.7.3
pg-protocol: 1.5.0
pg-types: 4.0.0
postgres-array: 3.0.1
postgres-interval: 4.0.0
roarr: 7.11.0
@ -15145,7 +15173,7 @@ packages:
dev: true
/typedarray/0.0.6:
resolution: {integrity: sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=}
resolution: {integrity: sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==}
/typescript/4.7.4:
resolution: {integrity: sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==}