Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
FACT Unified Data IO
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FACT
FACT Utils
FACT Unified Data IO
Commits
8ea693bc
Commit
8ea693bc
authored
3 months ago
by
Riccardo Boero
Browse files
Options
Downloads
Patches
Plain Diff
Fix results connection names to avoid misunderstandings
parent
e8dfb323
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
CHANGELOG
+4
-0
4 additions, 0 deletions
CHANGELOG
Project.toml
+1
-1
1 addition, 1 deletion
Project.toml
src/FACT_unified_data_IO.jl
+1
-1
1 addition, 1 deletion
src/FACT_unified_data_IO.jl
src/utils/db.jl
+15
-5
15 additions, 5 deletions
src/utils/db.jl
with
21 additions
and
7 deletions
CHANGELOG
+
4
−
0
View file @
8ea693bc
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Project.toml
+
1
−
1
View file @
8ea693bc
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"
...
...
This diff is collapsed.
Click to expand it.
src/FACT_unified_data_IO.jl
+
1
−
1
View file @
8ea693bc
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
src/utils/db.jl
+
15
−
5
View file @
8ea693bc
...
...
@@ -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)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment