input: from typing import Dict
  
  
  def fetch_data_as_json_api() -> Dict:
      """
      This function fetches data from an SQL database and returns it as a JSON response using the Flask framework.
      >>> fetch_data_as_json_api()
      {
          "data": [
              {"user_id": 1, "username": "user1", "email": "user1@example.com"},
              {"user_id": 2, "username": "user2", "email": "user2@example.com"}
          ]
      }
      """
output:     from flask import Flask, jsonify
      from flask_sqlalchemy import SQLAlchemy
  
      app = Flask(__name__)
      app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///example.db'
      db = SQLAlchemy(app)
  
      class User(db.Model):
          id = db.Column(db.Integer, primary_key=True)
          username = db.Column(db.String(80), unique=True, nullable=False)
          email = db.Column(db.String(120), unique=True, nullable=False)
  
      @app.route('/fetch_data', methods=['GET'])
      def fetch_data():
          users = User.query.all()
          data = [{"user_id": user.id, "username": user.username, "email": user.email} for user in users]
          return jsonify({"data": data})
  
      if __name__ == '__main__':
          app.run(debug=True)