From 2a7099b7c000c1c276a8c3f49e1bbd7ddf80ec98 Mon Sep 17 00:00:00 2001 From: kfilippopolitis Date: Tue, 19 Sep 2023 17:19:42 +0300 Subject: [PATCH] All the db credentials are loaded by env variables. --- mipdb/commands.py | 4 ++-- mipdb/tables.py | 7 ++++--- pyproject.toml | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/mipdb/commands.py b/mipdb/commands.py index 25ce429..3950112 100644 --- a/mipdb/commands.py +++ b/mipdb/commands.py @@ -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] diff --git a/mipdb/tables.py b/mipdb/tables.py index 1f18563..f66d5dd 100644 --- a/mipdb/tables.py +++ b/mipdb/tables.py @@ -1,3 +1,4 @@ +import os from abc import ABC, abstractmethod import json from enum import Enum @@ -18,9 +19,9 @@ class User(Enum): - executor = "executor" - admin = "admin" - guest = "guest" + executor = os.getenv('MONETDB_LOCAL_USERNAME', 'executor') + admin = os.getenv('MONETDB_ADMIN_USERNAME','admin') + guest = os.getenv('MONETDB_PUBLIC_USERNAME','guest') @compiles(sql.types.JSON, "monetdb") diff --git a/pyproject.toml b/pyproject.toml index 5696dd8..8815ab0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "mipdb" -version = "2.2.0" +version = "2.3.0" description = "" authors = ["Your Name "]