mapcomplete/scripts/osm2pgsql/createNewDatabase.ts

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
523 B
TypeScript
Raw Normal View History

2024-08-19 19:09:16 +02:00
import Script from "../Script"
import { OsmPoiDatabase } from "./osmPoiDatabase"
class CreateNewDatabase extends Script {
constructor() {
2024-09-02 13:09:41 +02:00
super(
"Creates a new version of the database. Usage: `createNewDatabase -- YYYY-MM-DD` which will create database `osm-poi.YYYY-MM-DD`"
)
2024-08-19 19:09:16 +02:00
}
async main(args: string[]): Promise<void> {
const db = new OsmPoiDatabase("postgresql://user:password@localhost:5444")
await db.createNew(args[0])
}
}
new CreateNewDatabase().run()