Skip to content

Commit ff558a8

Browse files
committed
feat: add DBTProjectConfig interface and type return
1 parent fd0dcf8 commit ff558a8

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

src/dbt_client/dbtIntegration.ts

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,31 @@ export const RESOURCE_TYPE_SNAPSHOT = "snapshot";
2929
export const RESOURCE_TYPE_TEST = "test";
3030
export const RESOURCE_TYPE_METRIC = "semantic_model";
3131

32-
export function readAndParseProjectConfig(projectRoot: string) {
32+
export interface DBTProjectConfig {
33+
name: string;
34+
version?: string;
35+
profile?: string;
36+
model_paths?: string[];
37+
analysis_paths?: string[];
38+
test_paths?: string[];
39+
seed_paths?: string[];
40+
macro_paths?: string[];
41+
snapshot_paths?: string[];
42+
target_path?: string;
43+
clean_targets?: string[];
44+
log_path?: string;
45+
packages_install_path?: string;
46+
models?: Record<string, any>;
47+
seeds?: Record<string, any>;
48+
snapshots?: Record<string, any>;
49+
sources?: Record<string, any>;
50+
tests?: Record<string, any>;
51+
vars?: Record<string, any>;
52+
}
53+
54+
export function readAndParseProjectConfig(
55+
projectRoot: string,
56+
): DBTProjectConfig {
3357
const dbtProjectConfigLocation = path.join(projectRoot, DBT_PROJECT_FILE);
3458
const dbtProjectYamlFile = readFileSync(dbtProjectConfigLocation, "utf8");
3559
return parse(dbtProjectYamlFile, {

0 commit comments

Comments
 (0)