hockey-blast-common-lib 0.1.18__py3-none-any.whl → 0.1.20__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- hockey_blast_common_lib/db_connection.py +18 -17
- hockey_blast_common_lib/utils.py +2 -2
- {hockey_blast_common_lib-0.1.18.dist-info → hockey_blast_common_lib-0.1.20.dist-info}/METADATA +1 -1
- {hockey_blast_common_lib-0.1.18.dist-info → hockey_blast_common_lib-0.1.20.dist-info}/RECORD +6 -6
- {hockey_blast_common_lib-0.1.18.dist-info → hockey_blast_common_lib-0.1.20.dist-info}/WHEEL +0 -0
- {hockey_blast_common_lib-0.1.18.dist-info → hockey_blast_common_lib-0.1.20.dist-info}/top_level.txt +0 -0
@@ -1,33 +1,34 @@
|
|
1
|
-
|
1
|
+
import os
|
2
2
|
from sqlalchemy import create_engine
|
3
3
|
from sqlalchemy.orm import sessionmaker
|
4
4
|
|
5
5
|
# Database connection parameters per organization
|
6
6
|
DB_PARAMS = {
|
7
7
|
"frontend": {
|
8
|
-
"dbname": "hockey_blast",
|
9
|
-
"user": "frontend_user",
|
10
|
-
"password": "hockey-blast",
|
11
|
-
"host": "localhost",
|
12
|
-
"port": 5432
|
8
|
+
"dbname": os.getenv("DB_NAME", "hockey_blast"),
|
9
|
+
"user": os.getenv("DB_USER", "frontend_user"),
|
10
|
+
"password": os.getenv("DB_PASSWORD", "hockey-blast"),
|
11
|
+
"host": os.getenv("DB_HOST", "localhost"),
|
12
|
+
"port": int(os.getenv("DB_PORT", 5432))
|
13
13
|
},
|
14
14
|
|
15
15
|
"frontend-sample-db": {
|
16
|
-
"dbname": "hockey_blast_sample",
|
17
|
-
"user": "frontend_user",
|
18
|
-
"password": "hockey-blast",
|
19
|
-
"host": "localhost",
|
20
|
-
"port": 5432
|
16
|
+
"dbname": os.getenv("DB_NAME_SAMPLE", "hockey_blast_sample"),
|
17
|
+
"user": os.getenv("DB_USER_SAMPLE", "frontend_user"),
|
18
|
+
"password": os.getenv("DB_PASSWORD_SAMPLE", "hockey-blast"),
|
19
|
+
"host": os.getenv("DB_HOST_SAMPLE", "localhost"),
|
20
|
+
"port": int(os.getenv("DB_PORT_SAMPLE", 5432))
|
21
21
|
},
|
22
22
|
|
23
|
+
# TODO - the section below is just to handle recovery of sample DB where boss user is present
|
24
|
+
# Maybe figure out a way to do backup without it and make frontend_user own the sample?
|
23
25
|
"boss": {
|
24
|
-
"dbname": "hockey_blast",
|
25
|
-
"user": "boss",
|
26
|
-
"password": "
|
27
|
-
"host": "localhost",
|
28
|
-
"port": 5432
|
26
|
+
"dbname": os.getenv("DB_NAME_BOSS", "hockey_blast"),
|
27
|
+
"user": os.getenv("DB_USER_BOSS", "boss"),
|
28
|
+
"password": os.getenv("DB_PASSWORD_BOSS", "boss"),
|
29
|
+
"host": os.getenv("DB_HOST_BOSS", "localhost"),
|
30
|
+
"port": int(os.getenv("DB_PORT_BOSS", 5432))
|
29
31
|
},
|
30
|
-
|
31
32
|
}
|
32
33
|
|
33
34
|
def get_db_params(config_name):
|
hockey_blast_common_lib/utils.py
CHANGED
@@ -82,8 +82,8 @@ def get_fake_human_for_stats(session):
|
|
82
82
|
|
83
83
|
return human.id
|
84
84
|
|
85
|
-
#
|
85
|
+
#TEST DB CONNECTION, PERMISSIONS...
|
86
86
|
# from hockey_blast_common_lib.db_connection import create_session
|
87
|
-
# session = create_session("
|
87
|
+
# session = create_session("frontend")
|
88
88
|
# human_id = get_fake_human_for_stats(session)
|
89
89
|
# print(f"Human ID: {human_id}")
|
{hockey_blast_common_lib-0.1.18.dist-info → hockey_blast_common_lib-0.1.20.dist-info}/RECORD
RENAMED
@@ -3,16 +3,16 @@ hockey_blast_common_lib/aggregate_goalie_stats.py,sha256=d2qav46Rg2DNIYRj_Ubj1kp
|
|
3
3
|
hockey_blast_common_lib/aggregate_human_stats.py,sha256=88OMhTgQjzc9xIakf6kW9_lZwbSXkpsZy8C0pX-Wlq8,14229
|
4
4
|
hockey_blast_common_lib/aggregate_referee_stats.py,sha256=A0PTyEbPUjqfXxlJCDOVioFaQk9AyjjhiWEuRuu35v0,11036
|
5
5
|
hockey_blast_common_lib/aggregate_skater_stats.py,sha256=37fhgej9trukr8cGaK7DT1HoxBcp95qwsypYCCziqqc,15563
|
6
|
-
hockey_blast_common_lib/db_connection.py,sha256=
|
6
|
+
hockey_blast_common_lib/db_connection.py,sha256=9jRHXXQr1KLIsV416O0uVrJTmhXPAVBCQ8Vxt55Hfus,1763
|
7
7
|
hockey_blast_common_lib/dump_sample_db.sh,sha256=MHPA-Ciod7wsvAlMbRtXFiyajgnEqU1xR59sJQ9UWR0,738
|
8
8
|
hockey_blast_common_lib/hockey_blast_sample_backup.sql.gz,sha256=JIk9FeWrEqHvmTLeueJtSkK2mNpg_xtonAMHDKlYe-4,1033693
|
9
9
|
hockey_blast_common_lib/models.py,sha256=GqQIGpanmFub97BoYCuaqDov2MxM4LMesUTxZ2edpvw,15393
|
10
10
|
hockey_blast_common_lib/options.py,sha256=-LtEX8duw5Pl3CSpjFlLM5FPvrZuTAxTfSlDPa7H6mQ,761
|
11
11
|
hockey_blast_common_lib/restore_sample_db.sh,sha256=u2zKazC6vNMULkpYzI64nlneCWaGUtDHPBAU-gWgRbw,1861
|
12
12
|
hockey_blast_common_lib/stats_models.py,sha256=PI-mL1jmjCHLAvaATxSsjHEn05g9L_reA_YpsITPWjQ,21047
|
13
|
-
hockey_blast_common_lib/utils.py,sha256=
|
13
|
+
hockey_blast_common_lib/utils.py,sha256=odDJWCK0BgbResXeoUzxbVChjaxcXr168ZxbrAw3L_8,3752
|
14
14
|
hockey_blast_common_lib/wsgi.py,sha256=wl1gf3KtaGSnYbCF5Z2xWwRXNSTQp43HoyhCAKJibI4,750
|
15
|
-
hockey_blast_common_lib-0.1.
|
16
|
-
hockey_blast_common_lib-0.1.
|
17
|
-
hockey_blast_common_lib-0.1.
|
18
|
-
hockey_blast_common_lib-0.1.
|
15
|
+
hockey_blast_common_lib-0.1.20.dist-info/METADATA,sha256=t1luPzQuJ4IjDQHx0xDxqcgzW8rqybVeRER54dVao8c,318
|
16
|
+
hockey_blast_common_lib-0.1.20.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
17
|
+
hockey_blast_common_lib-0.1.20.dist-info/top_level.txt,sha256=wIR4LIkE40npoA2QlOdfCYlgFeGbsHR8Z6r0h46Vtgc,24
|
18
|
+
hockey_blast_common_lib-0.1.20.dist-info/RECORD,,
|
File without changes
|
{hockey_blast_common_lib-0.1.18.dist-info → hockey_blast_common_lib-0.1.20.dist-info}/top_level.txt
RENAMED
File without changes
|