Skip to content
Snippets Groups Projects
Commit 8ea693bc authored by Riccardo Boero's avatar Riccardo Boero :innocent:
Browse files

Fix results connection names to avoid misunderstandings

parent e8dfb323
No related branches found
No related tags found
No related merge requests found
......@@ -9,6 +9,10 @@ Removed: For features removed in this release.
Fixed: For any bug fixes.
Security: For vulnerabilities.
## [0.0.3] - 12-10-2024
Fixed:
- names for results connections
## [0.0.2] - 12-10-2024
Fixed:
- use of system services for results
......
name = "FACT_unified_data_IO"
uuid = "ec8d5dc6-0dfe-41d7-8c2c-855ff50b7b42"
authors = ["Riccardo Boero <ribo@nilu.no>"]
version = "0.0.2"
version = "0.0.3"
[deps]
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
......
......@@ -36,7 +36,7 @@ module FACT_unified_data_IO
using OrchestratorRegistry
include("utils/db.jl")
export get_connection, close_connection
export get_results_connection, close_connection
include("utils/manifestIO.jl")
export get_table, write_table, overwrite_table, does_table_exist_for_method
......
......@@ -31,7 +31,7 @@ function create_manifest_table(conn::MySQL.Connection)
end
"""
create_database(service::OrchestratorRegistry.Service)
create_results_database(service::OrchestratorRegistry.Service)
Ensures the `FACT_results` database exists for the specified service.
......@@ -60,7 +60,7 @@ service = Service("123", "auth-service", "http://localhost", 3306)
create_database(service)
```
"""
function create_database(service::OrchestratorRegistry.Service)
function create_results_database(service::OrchestratorRegistry.Service)
conn = establish_connection(service.host, "root", "devops", ""; port=service.port)
# Prepare query
......@@ -74,7 +74,7 @@ function create_database(service::OrchestratorRegistry.Service)
end
"""
get_connection(service::OrchestratorRegistry.Service)
get_results_connection(service::OrchestratorRegistry.Service)
Establishes and returns a database connection for the specified service.
......@@ -112,9 +112,9 @@ conn = get_connection(service)
execute_query(conn, "SELECT * FROM manifest")
```
"""
function get_connection(service::OrchestratorRegistry.Service)
function get_results_connection(service::OrchestratorRegistry.Service)
# Create the databse if it does not exist
create_database(service)
create_results_database(service)
# Connect to the database
conn = establish_connection(service.host, "root", "devops", "FACT_results"; port=service.port)
......@@ -125,6 +125,16 @@ function get_connection(service::OrchestratorRegistry.Service)
return conn
end
function get_results_connection(service_dict::Dict)
service = Service(
"id",
"name",
service_dict["host"],
service_dict["port"]
)
return get_connection(service)
end
"""
close_connection(conn::MySQL.Connection)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment