diff --git a/src/api/anon-column.ts b/src/api/anon-column.ts index d64ba28..68550b2 100644 --- a/src/api/anon-column.ts +++ b/src/api/anon-column.ts @@ -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'; @@ -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) { diff --git a/src/api/anon-db.ts b/src/api/anon-db.ts index 0595859..f617b7b 100644 --- a/src/api/anon-db.ts +++ b/src/api/anon-db.ts @@ -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); @@ -20,7 +20,7 @@ export async function anonDb(config: Config): Promise { throw new Error('No uri in configuration'); } - const processor: Processor | undefined = getProcessor(uri); + const processor: Processor | undefined = getDatabaseProcessor(uri); logger(`processing ${dbName}`); if (processor) { diff --git a/src/cli/commands/anon-col/helpers/process-column.ts b/src/cli/commands/anon-col/helpers/process-column.ts index 2914b28..dfba74b 100644 --- a/src/cli/commands/anon-col/helpers/process-column.ts +++ b/src/cli/commands/anon-col/helpers/process-column.ts @@ -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( @@ -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 diff --git a/src/cli/commands/anon-db/anon-db.action.ts b/src/cli/commands/anon-db/anon-db.action.ts index 00e80b3..570601c 100644 --- a/src/cli/commands/anon-db/anon-db.action.ts +++ b/src/cli/commands/anon-db/anon-db.action.ts @@ -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'; @@ -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) { diff --git a/src/processors/get-processor.ts b/src/processors/get-db-processor.ts similarity index 96% rename from src/processors/get-processor.ts rename to src/processors/get-db-processor.ts index e33f9d5..ed78c12 100644 --- a/src/processors/get-processor.ts +++ b/src/processors/get-db-processor.ts @@ -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