input: from typing import Any, Dict
  
  def generate_rest_api(name: str) -> Dict[str, Any]:
      """Generate a REST API with Python and Flask that allows users to create, read, update, and delete records from a database.
      
      >>> generate_rest_api('my_app')
      {
          'app': <Flask 'my_app'>,
          'db': <SQLAlchemy object at ...>,
          'Record': <class '__main__.Record'>,
          'routes': {
              'get_records': <function get_records at 0x...>,
              'create_record': <function create_record at 0x...>,
              'update_record': <function update_record at 0x...>,
              'delete_record': <function delete_record at 0x...>
          }
      }
      """
output:     from flask import Flask, request, jsonify
      from flask_sqlalchemy import SQLAlchemy
  
      app = Flask(name)
      app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///my_app.db'
      db = SQLAlchemy(app)
  
      class Record(db.Model):
          id = db.Column(db.Integer, primary_key=True)
          data = db.Column(db.String(255), nullable=False)
  
      @app.route('/records', methods=['GET'])
      def get_records():
          records = Record.query.all()
          return jsonify([{'id': record.id, 'data': record.data} for record in records])
  
      @app.route('/records', methods=['POST'])
      def create_record():
          data = request.json.get('data')
          if not data:
              return jsonify({'error': 'Data is required'}), 400
          new_record = Record(data=data)
          db.session.add(new_record)
          db.session.commit()
          return jsonify({'id': new_record.id, 'data': new_record.data}), 201
  
      @app.route('/records/<int:id>', methods=['PUT'])
      def update_record(id):
          record = Record.query.get(id)
          if not record:
              return jsonify({'error': 'Record not found'}), 404
          data = request.json.get('data')
          if not data:
              return jsonify({'error': 'Data is required'}), 400
          record.data = data
          db.session.commit()
          return jsonify({'id': record.id, 'data': record.data})
  
      @app.route('/records/<int:id>', methods=['DELETE'])
      def delete_record(id):
          record = Record.query.get(id)
          if not record:
              return jsonify({'error': 'Record not found'}), 404
          db.session.delete(record)
          db.session.commit()
          return jsonify({'message': 'Record deleted'})
  
      return {
          'app': app,
          'db': db,
          'Record': Record,
          'routes': {
              'get_records': get_records,
              'create_record': create_record,
              'update_record': update_record,
              'delete_record': delete_record
          }
      }