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

Commit

Permalink
Experimental POST data support
Browse files Browse the repository at this point in the history
  • Loading branch information
lmangani authored Nov 2, 2023
1 parent 3a4ed23 commit dbc7df4
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,19 @@ def clickhouse():
@auth.login_required
def play():
query = request.get_data() or None
query_param = request.args.get('query', default="", type=str)
format = request.args.get('default_format', default="TSV", type=str)
database = request.args.get('database', default="", type=str)

if not query and query_param:
query = f"{query_param}".encode()

elif query and query_param:
query_param = f"{query_param} ".encode()
query = query_param + query

if not query:
return "Ok", 200
return "Error: no query parameter provided", 400

if database:
database = f"USE {database}; ".encode()
Expand Down

0 comments on commit dbc7df4

Please sign in to comment.