Skip to content

Commit 934d747

Browse files
committed
refactor: move type declaration
1 parent 7152565 commit 934d747

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

src/commands/db/transform.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,6 @@ import getConfig from "../../utils/config.js";
55
import path from "path";
66
import { removeFile, writeFile } from "../../utils/fs.js";
77

8-
export interface DbTransformation {
9-
getSourceTable: () => string;
10-
getSourceColumns: () => string[];
11-
transform: (data: object) => object;
12-
getDestinationTable: () => string;
13-
}
14-
158
export interface DuckDBConnection extends Connection {}
169

1710
export default class TransformDb extends DbBaseCommand<typeof DbBaseCommand> {

src/utils/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
DEFAULT_TABLES_DIR,
1515
} from "./constants.js";
1616
import { fileURLToPath } from "url";
17-
import { DbTransformation } from "../commands/db/transform.js";
17+
import { DbTransformation } from "./types.js";
1818

1919
const __dirname = dirname(fileURLToPath(import.meta.url));
2020
const { PATH_TO_ENV, PDPL_PATH_TO_ENV } = process.env;

src/utils/types.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,3 +100,10 @@ export interface OutputStrategy {
100100
isReady: (fields: KeyVal, data?: KeyVal) => string[];
101101
handle: OutputStrategyHandler;
102102
}
103+
104+
export interface DbTransformation {
105+
getSourceTable: () => string;
106+
getSourceColumns: () => string[];
107+
transform: (data: object) => object;
108+
getDestinationTable: () => string;
109+
}

0 commit comments

Comments
 (0)