Skip to content

Commit 6f9f4b8

Browse files
author
charlesgauthereau
committed
chore(release): 26.01.27
1 parent 35890a2 commit 6f9f4b8

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

commands/agent.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,11 @@ def agent(
5757
console.print(Panel("[bold]Database Setup[/bold]", style="cyan"))
5858

5959
while Confirm.ask("Do you want to configure a database?", default=True):
60-
mode = Prompt.ask("Configuration Mode", choices=["docker", "manual"], default="docker")
60+
mode = Prompt.ask("Configuration Mode", choices=["new", "existing"], default="docker")
6161

62-
if mode == "manual":
62+
if mode == "new":
6363
console.print("[info]External/Existing Database Configuration[/info]")
64-
db_type = Prompt.ask("Type", choices=["postgresql", "mysql", "mariadb", "mongodb-auth", "mongodb"], default="postgresql")
64+
db_type = Prompt.ask("Type", choices=["postgresql", "mysql", "mariadb", "mongodb"], default="postgresql")
6565
friendly_name = Prompt.ask("Display Name", default="External DB")
6666
db_name = Prompt.ask("Database Name")
6767
host = Prompt.ask("Host", default="localhost")
@@ -83,7 +83,7 @@ def agent(
8383

8484
else:
8585
console.print("[info]New Local Docker Container[/info]")
86-
db_engine = Prompt.ask("Engine", choices=["postgresql", "mariadb"], default="postgresql")
86+
db_engine = Prompt.ask("Engine", choices=["postgresql", "mysql", "mariadb", "mongodb-auth", "mongodb"], default="postgresql")
8787

8888
if db_engine == "postgresql":
8989
pg_port = get_free_port()
@@ -121,7 +121,7 @@ def agent(
121121
})
122122
console.print(f"[success]✔ Added Postgres container (Port {pg_port})[/success]")
123123

124-
elif db_engine == "mariadb":
124+
elif db_engine == "mariadb" or db_engine == "mysql":
125125
mysql_port = get_free_port()
126126
db_user = "admin"
127127
db_pass = secrets.token_hex(8)
@@ -148,7 +148,7 @@ def agent(
148148
add_db_to_json(path, {
149149
"name": db_name,
150150
"database": db_name,
151-
"type": "mysql",
151+
"type": db_engine,
152152
"username": db_user,
153153
"password": db_pass,
154154
"port": mysql_port,

core/config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ def add_db_to_json(path: Path, db_entry: dict):
7575
if "databases" not in config:
7676
config["databases"] = []
7777

78-
if "generatedId" not in db_entry:
79-
db_entry["generatedId"] = str(uuid.uuid4())
78+
if "generated_id" not in db_entry:
79+
db_entry["generated_id"] = str(uuid.uuid4())
8080

8181
config["databases"].append(db_entry)
8282
save_db_config(path, config)

0 commit comments

Comments
 (0)