mercredi 17 juin 2015

How to easily save some models from Django as SQLite?

I need in my project (based on Postresql) to export few models as SQLite dump. It must be made 'on-demand' f.e. on user request.

I can prepare appropriate database manually, but I would like to omit the duplication of information about schema. I dream about solution like 'dumpdata app-name' but instead of JSON/XML/YAML there should be SQLite.

Is there such solution?

P.S. For too overbearing - it's not broad question. Possibilities are only two: there is such snippet, helper etc. or there is not and it should be done individually. I can't find it by my own so I ask for help.

To sum up details (some people could not figure them out and could put my question 'on hold'):

  • there is Django project with main Postresql database
  • I'm already processing request from users (through an API)
  • one of request is "make a dump of some models (tables) in SQLite format"
  • I can prepare temporary SQLite database and manually fill it with data
  • I'm looking for powerful and universal tool (solution) which will do such export automatically (from some of my Django models to SQLite)

Aucun commentaire:

Enregistrer un commentaire