Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in
Toggle navigation
F
fund_report
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
彭熊
fund_report
Commits
d9d3e5a5
Commit
d9d3e5a5
authored
Nov 18, 2020
by
pengxiong@wealthgrow.cn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MySQL数据库引擎配置
parent
39fdda12
Pipeline
#3534
canceled with stages
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
10 deletions
+29
-10
fund_report.iml
.idea/fund_report.iml
+3
-0
engine.py
app/api/engine.py
+20
-7
config.yaml
app/config/config.yaml
+6
-3
No files found.
.idea/fund_report.iml
View file @
d9d3e5a5
...
...
@@ -5,4 +5,7 @@
<orderEntry
type=
"inheritedJdk"
/>
<orderEntry
type=
"sourceFolder"
forTests=
"false"
/>
</component>
<component
name=
"TestRunnerService"
>
<option
name=
"PROJECT_TEST_RUNNER"
value=
"Unittests"
/>
</component>
</module>
\ No newline at end of file
app/api/engine.py
View file @
d9d3e5a5
...
...
@@ -23,20 +23,20 @@ CFG_FILEPATH = work_dir + '/app/config/config.yaml'
config
=
yaml
.
load
(
open
(
CFG_FILEPATH
,
'r'
),
Loader
=
yaml
.
FullLoader
)
tamp_user_engine
=
create_engine
(
tamp_product_engine
=
create_engine
(
'mysql+pymysql://{user}:{password}@{host}:{port}/{db}?charset={charset}'
.
format
(
db
=
config
[
env
][
'MySQL'
][
'tamp_
user
_db'
],
db
=
config
[
env
][
'MySQL'
][
'tamp_
product
_db'
],
host
=
config
[
env
][
'MySQL'
][
'host'
],
port
=
config
[
env
][
'MySQL'
][
'port'
],
user
=
config
[
env
][
'MySQL'
][
'user'
],
password
=
config
[
env
][
'MySQL'
][
'password'
],
charset
=
"utf8"
),
charset
=
"utf8"
),
echo
=
True
)
tamp_
pay
_engine
=
create_engine
(
tamp_
order
_engine
=
create_engine
(
'mysql+pymysql://{user}:{password}@{host}:{port}/{db}?charset={charset}'
.
format
(
db
=
config
[
env
][
'MySQL'
][
'tamp_
pay
_db'
],
db
=
config
[
env
][
'MySQL'
][
'tamp_
order
_db'
],
host
=
config
[
env
][
'MySQL'
][
'host'
],
port
=
config
[
env
][
'MySQL'
][
'port'
],
user
=
config
[
env
][
'MySQL'
][
'user'
],
...
...
@@ -44,8 +44,21 @@ tamp_pay_engine = create_engine(
charset
=
"utf8"
),
echo
=
True
)
tamp_user_engine
=
create_engine
(
'mysql+pymysql://{user}:{password}@{host}:{port}/{db}?charset={charset}'
.
format
(
db
=
config
[
env
][
'MySQL'
][
'tamp_user_db'
],
host
=
config
[
env
][
'MySQL'
][
'host'
],
port
=
config
[
env
][
'MySQL'
][
'port'
],
user
=
config
[
env
][
'MySQL'
][
'user'
],
password
=
config
[
env
][
'MySQL'
][
'password'
],
charset
=
"utf8"
),
echo
=
True
)
tamp_product_session
=
sessionmaker
(
bind
=
tamp_product_engine
)()
tamp_order_session
=
sessionmaker
(
bind
=
tamp_order_engine
)()
tamp_user_session
=
sessionmaker
(
bind
=
tamp_user_engine
)()
tamp_pay_session
=
sessionmaker
(
bind
=
tamp_pay_engine
)()
# redis = redis.StrictRedis(
# host=config[env]['redis']['host'],
...
...
app/config/config.yaml
View file @
d9d3e5a5
dev
:
MySQL
:
tamp_product_db
:
tamp_product
tamp_order_db
:
tamp_order
tamp_user_db
:
tamp_user
tamp_pay_db
:
tamp_pay
host
:
47.101.189.151
port
:
31931
user
:
root
...
...
@@ -18,8 +19,9 @@ dev:
test
:
MySQL
:
tamp_product_db
:
tamp_product
tamp_order_db
:
tamp_order
tamp_user_db
:
tamp_user
tamp_pay_db
:
tamp_pay
host
:
118.190.63.109
port
:
3306
user
:
root
...
...
@@ -36,8 +38,9 @@ test:
prod
:
MySQL
:
tamp_product_db
:
tamp_product
tamp_order_db
:
tamp_order
tamp_user_db
:
tamp_user
tamp_pay_db
:
tamp_pay
host
:
pc-uf666afrpfg8yj768.rwlb.rds.aliyuncs.com
port
:
3306
user
:
tamp_pay
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment