Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
core_tools
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
QuTech QDLabs
core_tools
Commits
a9e8fb9f
Commit
a9e8fb9f
authored
1 month ago
by
Daan Bijl
Browse files
Options
Downloads
Patches
Plain Diff
modificatoin: allow for local postgresql database ports other than the default '5432'
parent
ac1c84be
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
core_tools/startup/db_connection.py
+7
-2
7 additions, 2 deletions
core_tools/startup/db_connection.py
with
7 additions
and
2 deletions
core_tools/startup/db_connection.py
+
7
−
2
View file @
a9e8fb9f
...
@@ -40,9 +40,14 @@ def _config_local_db(readonly):
...
@@ -40,9 +40,14 @@ def _config_local_db(readonly):
user
=
cfg
[
'
local_database.user
'
]
user
=
cfg
[
'
local_database.user
'
]
passwd
=
cfg
[
'
local_database.password
'
]
passwd
=
cfg
[
'
local_database.password
'
]
dbname
=
cfg
[
'
local_database.database
'
]
dbname
=
cfg
[
'
local_database.database
'
]
SQL_conn_info_local
(
'
localhost
'
,
5432
,
address
=
cfg
.
get
(
"
local_database.address
"
,
default
=
"
localhost:5432
"
)
host
,
port
=
address
.
split
(
"
:
"
)
if
host
!=
"
localhost
"
:
raise
RuntimeError
(
"
Illegal host name
'
{}
'
for local database. Should be
'
localhost
'
.
"
.
format
(
host
))
SQL_conn_info_local
(
host
,
int
(
port
),
user
,
passwd
,
dbname
,
user
,
passwd
,
dbname
,
readonly
)
readonly
)
print
(
"
connecting to host
'
{}
'
at port
'
{}
'
to database
'
{}
'"
.
format
(
host
,
port
,
dbname
))
def
_connect
():
def
_connect
():
global
_connected
global
_connected
...
@@ -51,4 +56,4 @@ def _connect():
...
@@ -51,4 +56,4 @@ def _connect():
query_for_samples
.
get_projects
()
query_for_samples
.
get_projects
()
_connected
=
True
_connected
=
True
except
:
except
:
raise
raise
\ No newline at end of file
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