input: Write a function to generate a REST API with Python and Flask that allows users to create, read, update, and delete records from a database. The function should return the Flask app instance, the SQLAlchemy instance, and the Record model.
  from flask import Flask, request
  from flask_sqlalchemy import SQLAlchemy
  
  assert generate_rest_api()[0].config['SQLALCHEMY_DATABASE_URI'] == 'sqlite:////tmp/test.db'
  assert isinstance(generate_rest_api()[0], Flask)
  assert isinstance(generate_rest_api()[1], SQLAlchemy)
  assert 'name' in generate_rest_api()[2].__dict__['columns']
  assert generate_rest_api()[0].view_functions['get_records'] is not None
  assert generate_rest_api()[0].view_functions['create_record'] is not None
  assert generate_rest_api()[0].view_functions['update_record'] is not None
  assert generate_rest_api()[0].view_functions['delete_record'] is not None
output: def generate_rest_api():
      app = Flask(__name__)
      app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:////tmp/test.db'
      db = SQLAlchemy(app)
  
      class Record(db.Model):
          id = db.Column(db.Integer, primary_key=True)
          name = db.Column(db.String(80), nullable=False)
  
      @app.route('/records', methods=['GET'])
      def get_records():
          records = Record.query.all()
          return {'records': [{'id': record.id, 'name': record.name} for record in records]}
  
      @app.route('/records', methods=['POST'])
      def create_record():
          data = request.json
          new_record = Record(name=data['name'])
          db.session.add(new_record)
          db.session.commit()
          return {'id': new_record.id, 'name': new_record.name}
  
      @app.route('/records/<int:id>', methods=['PUT'])
      def update_record(id):
          data = request.json
          record = Record.query.get(id)
          if record:
              record.name = data['name']
              db.session.commit()
              return {'id': record.id, 'name': record.name}
          return {'error': 'Record not found'}, 404
  
      @app.route('/records/<int:id>', methods=['DELETE'])
      def delete_record(id):
          record = Record.query.get(id)
          if record:
              db.session.delete(record)
              db.session.commit()
              return {'message': 'Record deleted'}
          return {'error': 'Record not found'}, 404
  
      return app, db, Record