Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
energy-monitor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
suazo2
energy-monitor
Merge requests
!11
Db setup
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Db setup
db-setup
into
main
Overview
0
Commits
5
Pipelines
0
Changes
8
Merged
suazo2
requested to merge
db-setup
into
main
1 year ago
Overview
0
Commits
5
Pipelines
0
Changes
8
Expand
Created by: afesuazo
0
0
Merge request reports
Compare
main
main (base)
and
latest version
latest version
5e99ded4
5 commits,
1 year ago
8 files
+
289
−
64
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
8
Search (e.g. *.vue) (Ctrl+P)
database/mysql_utils.py
0 → 100644
+
22
−
0
Options
import
mysql.connector
from
utils
import
load_config
class
SqlManager
:
def
__init__
(
self
):
self
.
conn
=
None
def
connect
(
self
):
config
=
load_config
()
config
=
config
[
"
database
"
]
self
.
conn
=
mysql
.
connector
.
connect
(
host
=
config
.
get
(
"
host
"
,
"
localhost
"
),
user
=
config
.
get
(
"
user
"
),
password
=
config
.
get
(
"
password
"
),
database
=
config
.
get
(
"
database
"
)
)
def
disconnect
(
self
):
self
.
conn
.
close
()
\ No newline at end of file
Loading