-
Notifications
You must be signed in to change notification settings - Fork 346
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
3,312 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
for_test/ | ||
sasl-0.3.1-cp310-cp310-win_amd64.whl | ||
__pycache__/ | ||
.idea/ | ||
connect.db | ||
not_sqlalchemy/ | ||
run_flask_app.bat |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# connector | ||
use sqlalchemy to connect database. | ||
|
||
It uses a method similar to Superset, and you can refer to its reference documentation. | ||
https://superset.apache.org/docs/databases/installing-database-drivers/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
from flask import Flask | ||
|
||
from bp import bp_Druid, bp_Drill, bp_Athena, bp_Clickhouse, bp_Oracle, bp_Sqlite, bp_SQLserver, bp_Doris, bp_Redshift, bp_Mysql, bp_Impala, bp_Kylin, bp_SparkSQL, bp_Postgres | ||
from bp import bp_database | ||
from database import init_db | ||
from database import db_session | ||
|
||
app = Flask(__name__) | ||
|
||
|
||
@app.route('/') | ||
def hello_world(): # put application's code here | ||
return 'Hello World!' | ||
|
||
|
||
@app.route("/ping") | ||
def ping(): | ||
return { | ||
"success": True | ||
} | ||
|
||
|
||
@app.teardown_appcontext | ||
def shutdown_session(exception=None): | ||
db_session.remove() | ||
|
||
|
||
# 注册蓝图 | ||
app.register_blueprint(bp_database.bp) | ||
|
||
|
||
init_db() | ||
|
||
if __name__ == '__main__': | ||
# init_db() | ||
app.run(host='0.0.0.0') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# 2022/9/5 | ||
# 17:57 |
Oops, something went wrong.