Upload folder using huggingface_hub
Browse files
app.py
CHANGED
@@ -25,6 +25,10 @@ def Connect():
|
|
25 |
cursor = conn.cursor()
|
26 |
return conn, cursor
|
27 |
|
|
|
|
|
|
|
|
|
28 |
thread = threading.Thread(target=Upload)
|
29 |
thread.start()
|
30 |
|
@@ -36,10 +40,14 @@ def HuggingFaceSpaceRoot():
|
|
36 |
def UptimeRobot():
|
37 |
return "OK"
|
38 |
|
39 |
-
@app.get("/sql")
|
40 |
@app.post("/sql")
|
41 |
def execute_sql(param: sql):
|
42 |
conn, cursor = Connect()
|
43 |
cursor.execute(param.sql)
|
44 |
-
conn
|
45 |
-
|
|
|
|
|
|
|
|
|
|
|
|
25 |
cursor = conn.cursor()
|
26 |
return conn, cursor
|
27 |
|
28 |
+
def Close(conn: sqlite3.Connection):
|
29 |
+
conn.commit()
|
30 |
+
conn.close()
|
31 |
+
|
32 |
thread = threading.Thread(target=Upload)
|
33 |
thread.start()
|
34 |
|
|
|
40 |
def UptimeRobot():
|
41 |
return "OK"
|
42 |
|
|
|
43 |
@app.post("/sql")
|
44 |
def execute_sql(param: sql):
|
45 |
conn, cursor = Connect()
|
46 |
cursor.execute(param.sql)
|
47 |
+
Close(conn)
|
48 |
+
|
49 |
+
@app.get("/sql")
|
50 |
+
def execute_sql_get(sql: str):
|
51 |
+
conn, cursor = Connect()
|
52 |
+
cursor.execute(sql)
|
53 |
+
Close(conn)
|