mapcomplete/scripts/osm2pgsql/deleteOldDbs.ts

16 lines
402 B
TypeScript
Raw Normal View History

2024-08-19 19:09:16 +02:00
import Script from "../Script"
import { OsmPoiDatabase } from "./osmPoiDatabase"
class DeleteOldDbs extends Script {
constructor() {
super("Drops all but the newest `osm-poi.*`")
}
async main(args: string[]): Promise<void> {
const db = new OsmPoiDatabase("postgresql://user:password@localhost:5444")
await db.deleteAllButLatest()
}
}
new DeleteOldDbs().run()