<s> import psycopg2 <EOL> from flask import Flask , request , jsonify <EOL> from mosql . query import select , left_join <EOL> from mosql . db import Database <EOL> db = Database ( psycopg2 , host = '<STR_LIT:127.0.0.1>' ) <EOL> app = Flask ( __name__ ) <EOL> @ app . route ( '<STR_LIT:/>' ) <EOL> def index ( ) : <EOL> with db as cur : <EOL> cur . execute ( select ( <EOL> '<STR_LIT>' , <EOL> request . args or None , <EOL> joins = left_join ( '<STR_LIT>' , using = ( '<STR_LIT>' , ) ) , <EOL> ) ) <EOL> return jsonify ( data = list ( cur ) ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> app . run ( debug = True ) </s>
