Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding environment DB_NAME, DP_PORT, CON_USER #1

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion lab0/env
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
IBM_APIKEY=<ibm_key>
SSDB_PASSWORD=<ssdb_password>
SSDB_HOST=<ssdb_host>
PROJECT_ID=<project-id>
PROJECT_ID=<project-id>
DB_NAME=<db-name>
CON_USER=<con-user>
DB_PORT=<db-port>
9 changes: 6 additions & 3 deletions lab1/genai-ssdb-lab01.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,10 @@
"ibm_apikey = os.getenv(\"IBM_APIKEY\", None)\n",
"ssdb_password = os.getenv(\"SSDB_PASSWORD\", None)\n",
"ssdb_host = os.getenv(\"SSDB_HOST\", None)\n",
"db_name = os.getenv(\"DB_NAME\", None)\n",
"db_port = os.getenv(\"DP_PORT\")\n",
"watson_project_id = os.getenv(\"PROJECT_ID\", None)\n",
"con_user = os.getenv(\"CON_USER\", None)\n",
"\n",
"if ibm_apikey is None or ssdb_password is None or ssdb_host is None or watson_project_id is None:\n",
" print(\"ERROR: DO NOT PROGRESS UNTILL YOU FIX THIS: Ensure you copied the .env file that you created earlier into the same directory as this notebook\")"
Expand All @@ -124,11 +127,11 @@
},
"outputs": [],
"source": [
"connection_user = 'admin'\n",
"connection_user = con_user\n",
"connection_password = ssdb_password\n",
"connection_port = '3306'\n",
"connection_port = db_port\n",
"connection_host = ssdb_host\n",
"database_name = 'watsonx_ibm_lab1'"
"database_name = db_name"
]
},
{
Expand Down
11 changes: 7 additions & 4 deletions lab2/sql-codegen-ssdb-lab02.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,12 @@
"#config watsonx.ai environment\n",
"load_dotenv()\n",
"ibm_apikey = os.getenv(\"IBM_APIKEY\", None)\n",
"watson_project_id = os.getenv(\"PROJECT_ID\", None)\n",
"ssdb_password = os.getenv(\"SSDB_PASSWORD\", None)\n",
"ssdb_host = os.getenv(\"SSDB_HOST\", None)\n",
"db_name = os.getenv(\"DB_NAME\", None)\n",
"db_port = os.getenv(\"DP_PORT\")\n",
"watson_project_id = os.getenv(\"PROJECT_ID\", None)\n",
"con_user = os.getenv(\"CON_USER\", None)\n",
"\n",
"if ibm_apikey is None or ssdb_password is None or ssdb_host is None or watson_project_id is None:\n",
" print(\"ERROR: DO NOT PROGRESS UNTILL YOU FIX THIS: Ensure you copied the .env file that you created earlier into the same directory as this notebook\")"
Expand All @@ -114,11 +117,11 @@
},
"outputs": [],
"source": [
"connection_user = 'admin'\n",
"connection_user = con_user\n",
"connection_password = ssdb_password\n",
"connection_port = '3306'\n",
"connection_port = db_port\n",
"connection_host = ssdb_host\n",
"database_name = 'watsonx_ibm_lab2'"
"database_name = db_name"
]
},
{
Expand Down