Re: Dumping all the sql statements as backup

Discussion in 'Python' started by andrea crotti, Jul 25, 2012.

  1. 2012/7/25 Jack <

    > 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.
    andrea crotti, Jul 25, 2012
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. gavino
    Replies:
    13
    Views:
    1,039
  2. Bigus

    Dumping all Variables

    Bigus, May 1, 2009, in forum: Perl Misc
    Replies:
    8
    Views:
    165
    ccc31807
    May 1, 2009
  3. andrea crotti

    Dumping all the sql statements as backup

    andrea crotti, Jul 25, 2012, in forum: Python
    Replies:
    2
    Views:
    233
    Jason Friedman
    Aug 31, 2012
  4. Jack
    Replies:
    0
    Views:
    208
  5. Replies:
    0
    Views:
    578
Loading...

Share This Page