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. ...@@ -9,6 +9,10 @@ Removed: For features removed in this release.
Fixed: For any bug fixes. Fixed: For any bug fixes.
Security: For vulnerabilities. Security: For vulnerabilities.
## [0.0.3] - 12-10-2024
Fixed:
- names for results connections
## [0.0.2] - 12-10-2024 ## [0.0.2] - 12-10-2024
Fixed: Fixed:
- use of system services for results - use of system services for results
......
name = "FACT_unified_data_IO" name = "FACT_unified_data_IO"
uuid = "ec8d5dc6-0dfe-41d7-8c2c-855ff50b7b42" uuid = "ec8d5dc6-0dfe-41d7-8c2c-855ff50b7b42"
authors = ["Riccardo Boero <ribo@nilu.no>"] authors = ["Riccardo Boero <ribo@nilu.no>"]
version = "0.0.2" version = "0.0.3"
[deps] [deps]
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
......
...@@ -36,7 +36,7 @@ module FACT_unified_data_IO ...@@ -36,7 +36,7 @@ module FACT_unified_data_IO
using OrchestratorRegistry using OrchestratorRegistry
include("utils/db.jl") include("utils/db.jl")
export get_connection, close_connection export get_results_connection, close_connection
include("utils/manifestIO.jl") include("utils/manifestIO.jl")
export get_table, write_table, overwrite_table, does_table_exist_for_method export get_table, write_table, overwrite_table, does_table_exist_for_method
......
...@@ -31,7 +31,7 @@ function create_manifest_table(conn::MySQL.Connection) ...@@ -31,7 +31,7 @@ function create_manifest_table(conn::MySQL.Connection)
end end
""" """
create_database(service::OrchestratorRegistry.Service) create_results_database(service::OrchestratorRegistry.Service)
Ensures the `FACT_results` database exists for the specified service. Ensures the `FACT_results` database exists for the specified service.
...@@ -60,7 +60,7 @@ service = Service("123", "auth-service", "http://localhost", 3306) ...@@ -60,7 +60,7 @@ service = Service("123", "auth-service", "http://localhost", 3306)
create_database(service) 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) conn = establish_connection(service.host, "root", "devops", ""; port=service.port)
# Prepare query # Prepare query
...@@ -74,7 +74,7 @@ function create_database(service::OrchestratorRegistry.Service) ...@@ -74,7 +74,7 @@ function create_database(service::OrchestratorRegistry.Service)
end end
""" """
get_connection(service::OrchestratorRegistry.Service) get_results_connection(service::OrchestratorRegistry.Service)
Establishes and returns a database connection for the specified service. Establishes and returns a database connection for the specified service.
...@@ -112,9 +112,9 @@ conn = get_connection(service) ...@@ -112,9 +112,9 @@ conn = get_connection(service)
execute_query(conn, "SELECT * FROM manifest") 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 the databse if it does not exist
create_database(service) create_results_database(service)
# Connect to the database # Connect to the database
conn = establish_connection(service.host, "root", "devops", "FACT_results"; port=service.port) conn = establish_connection(service.host, "root", "devops", "FACT_results"; port=service.port)
...@@ -125,6 +125,16 @@ function get_connection(service::OrchestratorRegistry.Service) ...@@ -125,6 +125,16 @@ function get_connection(service::OrchestratorRegistry.Service)
return conn return conn
end 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) 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