quimnuss
quimnuss

Reputation: 1561

Create postgres database from pony ORM

Is it possible to create a new database from pony ORM? We couldn't find it within pony ORM docs, it's always assumed the database exists or is using SQLite file.

We would like to create a testing database and drop it afterwards.

Upvotes: 2

Views: 506

Answers (2)

Adrian Klaver
Adrian Klaver

Reputation: 19655

No. Per:

https://docs.ponyorm.org/api_reference.html#sqlite

Supported databases

If you look at the .bind() API for the various databases, SQLite is the only one with create_db. This is because in SQLite creating a database is just creating a single file. The other engines need to go through their own program to initialize a database. You will need to create an independent script that creates the database.

Upvotes: 3

Mike Organek
Mike Organek

Reputation: 12484

If you have your sqlite database file, you can try using pgloader.

Upvotes: 0

Related Questions