MCPcopy Create free account
hub / github.com/CL-lau/SQL-GPT / index

Function index

front/front.py:11–25  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

9
10@app.route('/', methods=['GET', 'POST'])
11def index():
12 if request.method == 'POST':
13 action = request.form['action']
14 description = request.form['description']
15 sql_query = request.form['sql_query']
16 database_structure = request.form['database_structure']
17
18 if action == 'generate':
19 generated_query = generate_sql_query(description)
20 return render_template('index.html', generated_query=generated_query)
21 elif action == 'optimize':
22 optimized_query = optimize_sql_query(sql_query, database_structure)
23 return render_template('index.html', optimized_query=optimized_query)
24
25 return render_template('index.html')
26
27
28def generate_sql_query(description):

Callers

nothing calls this directly

Calls 2

generate_sql_queryFunction · 0.85
optimize_sql_queryFunction · 0.85

Tested by

no test coverage detected