@app.callback(Output('query-output', 'children'), ServersideOutput('all-df', 'data'), Input('store', 'data'), State('all-df', 'data'))
def render_query_res_table(data, all_df):
    df = df_transform(data)
    df = df[sorted(df.columns.tolist())]
    if (all_df is None):
        all_df = [{'df': df, 'time': datetime.now()}]
    else:
        all_df.append({'df': df, 'time': datetime.now()})
    return ([dash_table.DataTable(id='table', columns=[{'name': i, 'id': i} for i in df.columns], data=df.to_dict('records'), style_header={'backgroundColor': 'grey', 'fontWeight': 'bold'})], all_df)
@app.callback(Output('query-output', 'children'), ServersideOutput('all-df', 'data'), Input('store', 'data'), State('all-df', 'data'))
def render_query_res_table(data, all_df):
    df = df_transform(data)
    df = df[sorted(df.columns.tolist())]
    if (all_df is None):
        all_df = [{'df': df, 'time': datetime.now()}]
    else:
        all_df.append({'df': df, 'time': datetime.now()})
    return ([dash_table.DataTable(id='table', columns=[{'name': i, 'id': i} for i in df.columns], data=df.to_dict('records'), style_header={'backgroundColor': 'grey', 'fontWeight': 'bold'})], all_df)