- attached sqlsoupcommmit_example.py
sqlsoup missing .commit, .rollback, and .begin methods
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)
-
Account Deleted -
repo owner SQLSoup has been brought on board with modern
Session
usage for SQLA 0.6. ba00071e749886f9845c07c9d67d83bbf50d7e20 includescommit
androllback
for theSqlSoup
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 casebegin()
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 calldb.session.begin()
. -
repo owner - removed milestone
Removing milestone: 0.6.0 (automated comment)
- Log in to comment
sample script demonstrating possible defintion and usage of .commit, .rollback, and .begin methods on the SqlSoup class