sqlsoup missing .commit, .rollback, and .begin methods

Issue #1503 resolved
Former user created an issue

It is neither clear in the api nor the documentation for SqlSoup that it is necessary to do an explicit commit ( e.g.

from sqlalchemy.ext.sqlsoup import Session Session.commit()

)

in order to persist inserts and updates.

As per this posting:

http://markmail.org/message/uqpf43qvibxfmaz

A possible solution may be to include methods such as these to the SqlSoup class as in the attached file.

Comments (3)

  1. Mike Bayer repo owner

    SQLSoup has been brought on board with modern Session usage for SQLA 0.6. ba00071e749886f9845c07c9d67d83bbf50d7e20 includes commit and rollback for the SqlSoup object, using a default session, and produces the same usage you have in your example. You can also pass your own session with different behaviors, such as autocommit in which case begin() is relevant. the patch includes documentation about session and transaction integration, although I found it more appropriate to break away from sqlsoup's "handholding" style of docs for that part.

    I'm not as keen on begin() for the moment since its not useful by default now, but if you've configured your sqlsoup on an autocommit session you can call db.session.begin().

  2. Log in to comment