Skip to content

Commit

Permalink
All the db credentials are loaded by env variables.
Browse files Browse the repository at this point in the history
  • Loading branch information
KFilippopolitis committed Sep 19, 2023
1 parent 67db177 commit 869ed56
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
4 changes: 2 additions & 2 deletions mipdb/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ def __init__(self, *args, **kwargs):
option_to_env_var = {
"--ip": os.getenv("DB_IP"),
"--port": os.getenv("DB_PORT"),
"--username": os.getenv("DB_USERNAME"),
"--password": os.getenv("DB_PASSWORD"),
"--username": os.getenv("MONETDB_ADMIN_USERNAME"),
"--password": os.getenv("MONETDB_LOCAL_PASSWORD"),
"--db_name": os.getenv("DB_NAME"),
}
option = args[0][0]
Expand Down
19 changes: 16 additions & 3 deletions mipdb/tables.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
from abc import ABC, abstractmethod
import json
from enum import Enum
Expand All @@ -18,9 +19,21 @@


class User(Enum):
executor = "executor"
admin = "admin"
guest = "guest"
executor = (
"executor"
if not os.environ.get("MONETDB_LOCAL_USERNAME")
else os.environ.get("MY_ENV_VARIABLE")
)
admin = (
"admin"
if not os.environ.get("MONETDB_ADMIN_USERNAME")
else os.environ.get("MY_ENV_VARIABLE")
)
guest = (
"guest"
if not os.environ.get("MONETDB_PUBLIC_USERNAME")
else os.environ.get("MY_ENV_VARIABLE")
)


@compiles(sql.types.JSON, "monetdb")
Expand Down

0 comments on commit 869ed56

Please sign in to comment.