input: 
  from flask import Flask, jsonify, request
  import sqlite3
  import json
  
  def fetch_from_sql_db_as_json(database_name: str) -> json:
      """Fetch data from an SQL database and present it as JSON.
      >>> fetch_from_sql_db_as_json('database.db').json == [{'id': 1, 'name': 'Alice'}, {'id': 2, 'name': 'Bob'}]
      True
      >>> fetch_from_sql_db_as_json('nonexistent_db').json == []
      True
      """
      try:
          connection = sqlite3.connect(database_name)
          connection.row_factory = sqlite3.Row
          cur = connection.cursor()
          all_data = cur.execute('SELECT * FROM users;').fetchall()
          connection.close()
          return jsonify([dict(ix) for ix in all_data])
      except sqlite3.Error as e:
          print(f"An error occurred: {e}")
          return jsonify([])
  
  app = Flask(__name__)
  
  @app.route('/', methods=['GET'])
  def index():
      return fetch_from_sql_db_as_json('database.db')
  
  if __name__ == '__main__':
      app.run(debug=True)
  
output:     
      try:
          connection = sqlite3.connect(database_name)
          connection.row_factory = sqlite3.Row
          cur = connection.cursor()
          all_data = cur.execute('SELECT * FROM users;').fetchall()
          connection.close()
          return jsonify([dict(ix) for ix in all_data])
      except sqlite3.Error as e:
          print(f"An error occurred: {e}")
          return jsonify([])
  