Last active
September 7, 2019 15:31
-
-
Save dtaivpp/5bc70a5407e81d25f41b30941b1dee11 to your computer and use it in GitHub Desktop.
This is an example of how not to generate sql table queries dynamically
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def gen_table_sql(table_obj): | |
row_len = length(table_obj) | |
query = "" | |
for index, row in enumerate(table_obj['columns']): | |
query.append(row) | |
# Needed so last line doesnt have a comma | |
if (index < length): | |
query.append(',\n') | |
return query |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment