From 4903fc7d831bfddb7df27c35f06eb0bf6ecd50f0 Mon Sep 17 00:00:00 2001 From: Espen Holtebu Date: Wed, 20 Dec 2023 10:32:00 +0100 Subject: [PATCH] Schema som parameter --- start_vscode_dbt.ps1 | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/start_vscode_dbt.ps1 b/start_vscode_dbt.ps1 index 6ffe84f..2079b38 100644 --- a/start_vscode_dbt.ps1 +++ b/start_vscode_dbt.ps1 @@ -1,7 +1,8 @@ # Path to wher you would like to place the python virtual env $dbtEnv_path = "C:\datavarehus\.dbtenv" -# Database schema -$schema = + + + #Function to set up a virtual env for dbt function Add-dbtenv { @@ -27,6 +28,16 @@ if ($args[0]) { exit } +#Database schema +if ($args[1]) { + # Database schema + $schema = $args[1].ToUpper() + Write-Host "Setting schema to: $schema" + } else { + Write-Host "Missing scheam. Pass schema as second argument this script." + exit + } + Try { Write-Host "Checking if path $dbtPath exists ..." @@ -96,4 +107,4 @@ Remove-Item -Path Env:https_proxy $env:ORA_PYTHON_DRIVER_TYPE = "thin" echo "ORA_PYTHON_DRIVER_TYPE: $env:ORA_PYTHON_DRIVER_TYPE" -code ../ \ No newline at end of file +code . \ No newline at end of file