Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #26043 > unrolled thread
| Started by | andrea crotti <andrea.crotti.0@gmail.com> |
|---|---|
| First post | 2012-07-25 16:31 +0100 |
| Last post | 2012-07-25 16:31 +0100 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: Dumping all the sql statements as backup andrea crotti <andrea.crotti.0@gmail.com> - 2012-07-25 16:31 +0100
| From | andrea crotti <andrea.crotti.0@gmail.com> |
|---|---|
| Date | 2012-07-25 16:31 +0100 |
| Subject | Re: Dumping all the sql statements as backup |
| Message-ID | <mailman.2574.1343230304.4697.python-list@python.org> |
2012/7/25 Jack <tdldev@gmail.com > Since you know the content of what the sql code is, why not just build > the sql file(s) needed and store them so that in case of a burp you can > just execute the code file. If you don't know the exact sql code, dump > it to a file as the statements are constructed... The only problem you > would run into in this scenario is duplicate data, which is also easily > solvable by using transaction-level commits to the db. > -- > http://mail.python.org/mailman/listinfo/python-list Yes but how do I construct them with SqlAlchemy? One possible option I found is to enable the logging of some parts of SqlAlchemy, and use that log, (echo=True in create_engine does something similar) but maybe there is a better option.. But I need to filter only the insert/update/delete probably.. And in general the processes have to run independently so in case of database connection problems I would just let them retry until it actually works. When the transaction actually works then in the backed up log I can add a marker(or archive the log), to avoid replaying it.
Back to top | Article view | comp.lang.python
csiph-web