{% for table in db.enumerate_tables(files=False) %} CREATE TABLE "{{ table.tablename | replace('"', '_') }}" ( {%- for field in table.fields %} "{{ field.name | replace('"', '_') }}" {{ field.sqltype() -}} {{- ", " if not loop.last else "" -}} {%- endfor %} ); INSERT INTO "{{ table.tablename | replace('"', '_') }}" VALUES {%- for record in db.enumerate_records( table ) %} ( {%- for field in record.fields -%} '{{ field.content | replace("'", "''") }}' {{- ", " if not loop.last else "" -}} {%- endfor -%} ) {{- ", " if not loop.last else "" -}} {%- endfor %} ; {% endfor %}