Skip to content
This repository was archived by the owner on Dec 29, 2023. It is now read-only.

Commit dbc7df4

Browse files
authored
Experimental POST data support
1 parent 3a4ed23 commit dbc7df4

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

main.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,19 @@ def clickhouse():
6565
@auth.login_required
6666
def play():
6767
query = request.get_data() or None
68+
query_param = request.args.get('query', default="", type=str)
6869
format = request.args.get('default_format', default="TSV", type=str)
6970
database = request.args.get('database', default="", type=str)
71+
72+
if not query and query_param:
73+
query = f"{query_param}".encode()
74+
75+
elif query and query_param:
76+
query_param = f"{query_param} ".encode()
77+
query = query_param + query
78+
7079
if not query:
71-
return "Ok", 200
80+
return "Error: no query parameter provided", 400
7281

7382
if database:
7483
database = f"USE {database}; ".encode()

0 commit comments

Comments
 (0)