input: Write a python function to handle user data in a SQLite database using Flask.
  assert user('POST', {'data': 'test_data'}) == {'data': 'test_data'}
  assert user('GET') == [{'data': 'test_data'}]
output: from flask import Flask, request, jsonify
  import sqlite3
  
  app = Flask(__name__)
  
  # Initialize SQLite database
  def init_db():
      conn = sqlite3.connect('database.db')
      cursor = conn.cursor()
      cursor.execute('''
      CREATE TABLE IF NOT EXISTS users (
          id INTEGER PRIMARY KEY AUTOINCREMENT,
          data TEXT
      )
      ''')
      conn.commit()
      conn.close()
  
  init_db()
  
  @app.route('/user', methods=['POST', 'GET'])
  def user():
      conn = sqlite3.connect('database.db')
      cursor = conn.cursor()
      
      if request.method == 'POST':
          user_data = request.json
          cursor.execute('INSERT INTO users (data) VALUES (?)', (user_data['data'],))
          conn.commit()
          conn.close()
          return jsonify(user_data)
      
      elif request.method == 'GET':
          cursor.execute('SELECT data FROM users')
          rows = cursor.fetchall()
          conn.close()
          return jsonify([{'data': row[0]} for row in rows])
  
  if __name__ == '__main__':
      app.run(debug=True)