开发者

can we get the postgres db dump using SQLAlchemy?

开发者 https://www.devze.com 2023-01-10 03:29 出处:网络
Is it possible to have the postgres database dump(pg_dump) using SQLAlchemy? i can get the dump using pg_dump but I am do开发者_如何学运维ing all other db operations using SQLALchemy and thus want to

Is it possible to have the postgres database dump(pg_dump) using SQLAlchemy? i can get the dump using pg_dump but I am do开发者_如何学运维ing all other db operations using SQLALchemy and thus want to know if this dump operation is also opssible using SQLAlchemy. Any suggestion, link would be of great help.

Thanks, Tara Singh


pg_dump is a system command.so I do not think you could have postgres database dump using SQLAlchemy.


SqlAlchemy do not manage sort of pg_dump. You probably can mimic it with a buch of queries but it will be painfull.

The more easy way is to use pg_dump itself inside a python script with os.system or subprocess.call

If it's for regular saves also have a look to safekeep project who speak for you to your databases

0

精彩评论

暂无评论...
验证码 换一张
取 消