Skip to content

Commit

Permalink
chore: change databases
Browse files Browse the repository at this point in the history
  • Loading branch information
nitzano committed Sep 22, 2023
1 parent cd04183 commit 940bbb3
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/api/anon-column.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {type Anonymizer} from '../anonymizers/types';
import {createAnonymizer} from '../anonymizers/utils/create-anonymizer';
import {type Processor} from '../processors/base-processor/processor';
import {getProcessor} from '../processors/get-processor';
import {getDatabaseProcessor} from '../processors/get-db-processor';
import {createLogger} from '../services/loggers/debug-logger';
import {type Provider} from '../types/types';

Expand Down Expand Up @@ -29,7 +29,7 @@ export async function anonColumn(
throw new Error('No uri in configuration');
}

const processor: Processor | undefined = getProcessor(uri);
const processor: Processor | undefined = getDatabaseProcessor(uri);

logger(`processing ${dbName}`);
if (processor) {
Expand Down
4 changes: 2 additions & 2 deletions src/api/anon-db.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {type Config} from '../config/types';
import {type Processor} from '../processors/base-processor/processor';
import {getCollections} from '../processors/databases/utils/get-collections';
import {getProcessor} from '../processors/get-processor';
import {getDatabaseProcessor} from '../processors/get-db-processor';
import {createLogger} from '../services/loggers/debug-logger';

const logger = createLogger(__filename);
Expand All @@ -20,7 +20,7 @@ export async function anonDb(config: Config): Promise<void> {
throw new Error('No uri in configuration');
}

const processor: Processor | undefined = getProcessor(uri);
const processor: Processor | undefined = getDatabaseProcessor(uri);

logger(`processing ${dbName}`);
if (processor) {
Expand Down
5 changes: 3 additions & 2 deletions src/cli/commands/anon-col/helpers/process-column.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import ora from 'ora';
import {type Anonymizer} from '../../../../anonymizers/types';
import {type Processor} from '../../../../processors/base-processor/processor';
import {getProcessor} from '../../../../processors/get-processor';
import {getDatabaseProcessor} from '../../../../processors/get-db-processor';
import {isUserConfirmed} from './is-user-confirmed';

export async function processColumn(
Expand All @@ -12,7 +12,8 @@ export async function processColumn(
columnName: string,
checkConfirm = true,
) {
const processor: Processor | undefined = getProcessor(connectionString);
const processor: Processor | undefined =
getDatabaseProcessor(connectionString);

if (processor) {
// Check confirm
Expand Down
4 changes: 2 additions & 2 deletions src/cli/commands/anon-db/anon-db.action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {type Command} from 'commander';
import {type Config} from '../../../config/types';
import {type Processor} from '../../../processors/base-processor/processor';
import {getCollections} from '../../../processors/databases/utils/get-collections';
import {getProcessor} from '../../../processors/get-processor';
import {getDatabaseProcessor} from '../../../processors/get-db-processor';
import {createLogger} from '../../../services/loggers/debug-logger';
import {processDb} from './process-db';
import {loadDbzarConfig} from './utils/load-dbzar-config';
Expand All @@ -25,7 +25,7 @@ export async function anonDbAction(this: Command) {

logger(`uri = ${uri}`);

const processor: Processor | undefined = getProcessor(uri);
const processor: Processor | undefined = getDatabaseProcessor(uri);
const collections = getCollections(config);

if (processor && collections) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {MariaDbProcessor} from './databases/mariadb/mariadb-processor';
import {MongoProcessor} from './databases/mongo/mongo-processor';
import {PostgresProcessor} from './databases/postgres/postgres/postgres-processor';

export function getProcessor(
export function getDatabaseProcessor(
connectionStringUri: string,
): Processor | undefined {
// Parse the engine
Expand Down

0 comments on commit 940bbb3

Please sign in to comment.