chore(deps): bump knex from 0.21.18 to 0.95.1
Bumps [knex](https://github.com/knex/knex) from 0.21.18 to 0.95.1. - [Release notes](https://github.com/knex/knex/releases) - [Changelog](https://github.com/knex/knex/blob/master/CHANGELOG.md) - [Commits](https://github.com/knex/knex/commits) Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
committed by
Fredrik Adelöw
parent
955e2a7a6f
commit
7616988312
@@ -47,7 +47,7 @@
|
||||
"git-url-parse": "^11.4.4",
|
||||
"helmet": "^4.0.0",
|
||||
"isomorphic-git": "^1.8.0",
|
||||
"knex": "^0.21.6",
|
||||
"knex": "^0.95.1",
|
||||
"lodash": "^4.17.15",
|
||||
"logform": "^2.1.1",
|
||||
"minimatch": "^3.0.4",
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import Knex from 'knex';
|
||||
import { Knex } from 'knex';
|
||||
import { Config } from '@backstage/config';
|
||||
import { createDatabaseClient, ensureDatabaseExists } from './connection';
|
||||
import { PluginDatabaseManager } from './types';
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import knex from 'knex';
|
||||
import knexFactory, { Knex } from 'knex';
|
||||
import { Config } from '@backstage/config';
|
||||
import { mergeDatabaseConfig } from './config';
|
||||
import { createPgDatabaseClient, ensurePgDatabaseExists } from './postgres';
|
||||
@@ -30,7 +30,7 @@ type DatabaseClient = 'pg' | 'sqlite3' | string;
|
||||
*/
|
||||
export function createDatabaseClient(
|
||||
dbConfig: Config,
|
||||
overrides?: Partial<knex.Config>,
|
||||
overrides?: Partial<Knex.Config>,
|
||||
) {
|
||||
const client: DatabaseClient = dbConfig.getString('client');
|
||||
|
||||
@@ -40,7 +40,7 @@ export function createDatabaseClient(
|
||||
return createSqliteDatabaseClient(dbConfig);
|
||||
}
|
||||
|
||||
return knex(mergeDatabaseConfig(dbConfig.get(), overrides));
|
||||
return knexFactory(mergeDatabaseConfig(dbConfig.get(), overrides));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import knex, { PgConnectionConfig } from 'knex';
|
||||
import knexFactory, { Knex } from 'knex';
|
||||
import { Config } from '@backstage/config';
|
||||
import { mergeDatabaseConfig } from './config';
|
||||
|
||||
@@ -26,10 +26,10 @@ import { mergeDatabaseConfig } from './config';
|
||||
*/
|
||||
export function createPgDatabaseClient(
|
||||
dbConfig: Config,
|
||||
overrides?: knex.Config,
|
||||
overrides?: Knex.Config,
|
||||
) {
|
||||
const knexConfig = buildPgDatabaseConfig(dbConfig, overrides);
|
||||
const database = knex(knexConfig);
|
||||
const database = knexFactory(knexConfig);
|
||||
return database;
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ export function createPgDatabaseClient(
|
||||
*/
|
||||
export function buildPgDatabaseConfig(
|
||||
dbConfig: Config,
|
||||
overrides?: knex.Config,
|
||||
overrides?: Knex.Config,
|
||||
) {
|
||||
return mergeDatabaseConfig(
|
||||
dbConfig.get(),
|
||||
@@ -62,7 +62,7 @@ export function buildPgDatabaseConfig(
|
||||
export function getPgConnectionConfig(
|
||||
dbConfig: Config,
|
||||
parseConnectionString?: boolean,
|
||||
): PgConnectionConfig | string {
|
||||
): Knex.PgConnectionConfig | string {
|
||||
const connection = dbConfig.get('connection') as any;
|
||||
const isConnectionString =
|
||||
typeof connection === 'string' || connection instanceof String;
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import knex from 'knex';
|
||||
import knexFactory, { Knex } from 'knex';
|
||||
import { Config } from '@backstage/config';
|
||||
import { mergeDatabaseConfig } from './config';
|
||||
|
||||
@@ -26,10 +26,10 @@ import { mergeDatabaseConfig } from './config';
|
||||
*/
|
||||
export function createSqliteDatabaseClient(
|
||||
dbConfig: Config,
|
||||
overrides?: knex.Config,
|
||||
overrides?: Knex.Config,
|
||||
) {
|
||||
const knexConfig = buildSqliteDatabaseConfig(dbConfig, overrides);
|
||||
const database = knex(knexConfig);
|
||||
const database = knexFactory(knexConfig);
|
||||
|
||||
database.client.pool.on('createSuccess', (_eventId: any, resource: any) => {
|
||||
resource.run('PRAGMA foreign_keys = ON', () => {});
|
||||
@@ -46,7 +46,7 @@ export function createSqliteDatabaseClient(
|
||||
*/
|
||||
export function buildSqliteDatabaseConfig(
|
||||
dbConfig: Config,
|
||||
overrides?: knex.Config,
|
||||
overrides?: Knex.Config,
|
||||
) {
|
||||
return mergeDatabaseConfig(
|
||||
dbConfig.get(),
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import knex from 'knex';
|
||||
import { Knex } from 'knex';
|
||||
|
||||
/**
|
||||
* The PluginDatabaseManager manages access to databases that Plugins get.
|
||||
@@ -26,5 +26,5 @@ export interface PluginDatabaseManager {
|
||||
* The purpose of this method is to allow plugins to get isolated data
|
||||
* stores so that plugins are discouraged from database integration.
|
||||
*/
|
||||
getClient(): Promise<knex>;
|
||||
getClient(): Promise<Knex>;
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
"example-app": "^0.2.18",
|
||||
"express": "^4.17.1",
|
||||
"express-promise-router": "^3.0.3",
|
||||
"knex": "^0.21.6",
|
||||
"knex": "^0.95.1",
|
||||
"pg": "^8.3.0",
|
||||
"pg-connection-string": "^2.3.0",
|
||||
"sqlite3": "^5.0.0",
|
||||
|
||||
Reference in New Issue
Block a user