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

Commit efb78ce

Browse files
authored
Fix database GET/POST
1 parent eb9ff75 commit efb78ce

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Diff for: main.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def clickhouse():
5454
return app.send_static_file('play.html')
5555

5656
if database:
57-
database = "USE " + database + "; "
57+
database = f"USE {database}; "
5858

5959
result, errmsg = chdb_query_with_errmsg(database + query, format)
6060
if len(errmsg) == 0:
@@ -72,7 +72,7 @@ def play():
7272
return "Ok", 200
7373

7474
if database:
75-
database = "USE " + database + "; "
75+
database = f"USE {database}; ".encode()
7676

7777
result, errmsg = chdb_query_with_errmsg(database + query, format)
7878
if len(errmsg) == 0:
@@ -92,7 +92,6 @@ def handle_ping():
9292
def handle_404(e):
9393
return app.send_static_file('play.html')
9494

95-
9695
host = os.getenv('HOST', '0.0.0.0')
9796
port = os.getenv('PORT', 8123)
9897
path = os.getenv('DATA', '.chdb_data')

0 commit comments

Comments
 (0)