Create SQL for tables in the tables list
Template $for tables$create table $table$ ( … );$if columns.primary_key$alter table $table$ add primary key ( … );$end$$end$
Notes:
The template to generate SQL is easily modified to iterate over the list of tables. For each entry in the list, this template generates the SQL to create the table and identify its primary key column.