def cleanup_temp_tables(db: PostgreSQL): """ Delete the intermediate tables to keep the DB clean """ for tbl in [ "trail_splits", "trail_merged", "sidewalk_splits", "sidewalk_merged" ]: db.table_delete(tbl)
def _test_transfer_data_spatial(db1: PostgreSQL, db2: PostgreSQL, shp: DataForTest): table_name = shp.NAME # Make sure that this table does not exist in the 2nd database if table_name in db2.all_tables_as_list(): db2.table_delete(table_name) # Transfer to the 2nd database db1.transfer_data_to_another_db(table_name, db2) # Confirm there is now a table in the DB assert table_name in db2.all_spatial_tables_as_dict()