Explains SQL in natural language
()
| 81 | |
| 82 | @bp.route('/explain_sql', methods=['POST']) |
| 83 | def explain_sql(): |
| 84 | """ |
| 85 | Explains SQL in natural language |
| 86 | """ |
| 87 | request_body = request.get_json() |
| 88 | sql = request_body.get('sql') |
| 89 | if not sql: |
| 90 | error_msg = '`sql` is missing from request body' |
| 91 | return make_response(jsonify({"error": error_msg}), 400) |
| 92 | explanation = get_sql_explanation(sql) |
| 93 | return make_response(jsonify({'explanation': explanation}), 200) |
| 94 | |
| 95 | |
| 96 | @bp.route('/text_to_sql', methods=['POST']) |
nothing calls this directly
no test coverage detected