diff options
author | Philip Sargent <philip.sargent@klebos.com> | 2022-11-23 10:48:39 +0000 |
---|---|---|
committer | Philip Sargent <philip.sargent@klebos.com> | 2022-11-23 10:48:39 +0000 |
commit | b06d1dae4222cdb6e50fef629967bc76625b52e9 (patch) | |
tree | 5526634dc2d0c3097e27f611da23fcafd5197f32 /dump.py | |
parent | 45a640dfe9aa5da411992668273e525ee6150b4b (diff) | |
download | troggle-b06d1dae4222cdb6e50fef629967bc76625b52e9.tar.gz troggle-b06d1dae4222cdb6e50fef629967bc76625b52e9.tar.bz2 troggle-b06d1dae4222cdb6e50fef629967bc76625b52e9.zip |
Convert.format() to f-strings with flynt
Diffstat (limited to 'dump.py')
-rw-r--r-- | dump.py | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -46,11 +46,11 @@ def _iterdump(connection): # qtable,
# sql.replace("''")))
else:
- yield('{0};'.format(sql))
+ yield(f'{sql};')
# Build the insert statement for each row of the current table
table_name_ident = table_name.replace('"', '""')
- res = cu.execute('PRAGMA table_info("{0}")'.format(table_name_ident))
+ res = cu.execute(f'PRAGMA table_info("{table_name_ident}")')
column_names = [str(table_info[1]) for table_info in res.fetchall()]
q = """SELECT 'INSERT INTO "{0}" VALUES({1})' FROM "{0}";""".format(
table_name_ident,
@@ -68,6 +68,6 @@ def _iterdump(connection): """
schema_res = cu.execute(q)
for name, type, sql in schema_res.fetchall():
- yield('{0};'.format(sql))
+ yield(f'{sql};')
yield('COMMIT;')
\ No newline at end of file |