(ctx)
| 58 | ) |
| 59 | |
| 60 | def id_generator(ctx): |
| 61 | # in reality, might want to use a separate transaction for this. |
| 62 | |
| 63 | with db1.begin() as c: |
| 64 | nextid = c.execute(ids.select().with_for_update()).scalar() |
| 65 | c.execute( |
| 66 | ids.update().values({ids.c.nextid: ids.c.nextid + 1}) |
| 67 | ) |
| 68 | return nextid |
| 69 | |
| 70 | cls.tables.weather_locations = weather_locations = Table( |
| 71 | "weather_locations", |