Explains SQL in natural language
()
| 6 | |
| 7 | @bp.route('/explain_sql', methods=['POST']) |
| 8 | def get_tables(): |
| 9 | """ |
| 10 | Explains SQL in natural language |
| 11 | """ |
| 12 | request_body = request.get_json() |
| 13 | sql = request_body.get('sql') |
| 14 | |
| 15 | if not sql: |
| 16 | error_msg = '`sql` is missing from request body' |
| 17 | return make_response(jsonify({"error": error_msg}), 400) |
| 18 | |
| 19 | explanation = get_sql_explanation(sql) |
| 20 | return make_response(jsonify({'explanation': explanation}), 200) |
nothing calls this directly
no test coverage detected