input: Write a function to implement a REST API using Python and Flask that allows users to create, read, update, and delete records from a database. The database should be SQLite and the records should include an ID and a name field. Implement the necessary routes for CRUD operations and return appropriate responses.
  assert get_records() == {'records': []}
  assert create_record({'name': 'test_name'}) == {'id': 1}
  assert get_records() == {'records': ['test_name']}
  assert update_record(1, {'name': 'new_name'}) == {'message': 'Record updated'}
  assert get_records() == {'records': ['new_name']}
  assert delete_record(1) == {'message': 'Record deleted'}
  assert get_records() == {'records': []}
output: 
  def get_records():
      conn = sqlite3.connect('database.db')
      cursor = conn.cursor()
      cursor.execute("SELECT name FROM records")
      records = [row[0] for row in cursor.fetchall()]
      conn.close()
      return {'records': records}
  
  def create_record(record):
      conn = sqlite3.connect('database.db')
      cursor = conn.cursor()
      cursor.execute("INSERT INTO records (name) VALUES (?)", (record['name'],))
      record_id = cursor.lastrowid
      conn.commit()
      conn.close()
      return {'id': record_id}
  
  def update_record(record_id, record):
      conn = sqlite3.connect('database.db')
      cursor = conn.cursor()
      cursor.execute("UPDATE records SET name = ? WHERE id = ?", (record['name'], record_id))
      conn.commit()
      conn.close()
      return {'message': 'Record updated'}
  
  def delete_record(record_id):
      conn = sqlite3.connect('database.db')
      cursor = conn.cursor()
      cursor.execute("DELETE FROM records WHERE id = ?", (record_id,))
      conn.commit()
      conn.close()
      return {'message': 'Record deleted'}
  