mysql_plugin
mysql_plugin copied to clipboard
How to get the real table column as part of the results as well?
results = [dict([k, str(v)] if v is not None else [k, v]
for k, v in enumerate(i)) for i in results]
results = '\n'.join([json.dumps(i) for i in list(results)])
If we just run it by this. For example if the data on the table in mysql is, id: 1 value:100
the results will come out on S3 as {"0":"1", "1":"100"}
But I want to get a result like this = {"id":"1", "value":"100"}