peewee Documentation Release 3.4.0by the atomic() context manager, you can explicitly rollback or commit at any point by calling Transaction.rollback() or Transaction.commit(). When you do this inside a wrapped block of code, a new transaction aving) # Note: no need to call commit. Since this marks the end of the # wrapped block of code, the `atomic` context manager will # automatically call commit for us. Note atomic() can be used transaction will be started. with db.transaction() as txn: User.create(username='mickey') txn.commit() # Changes are saved and a new transaction begins. User.create(username='huey') # Roll back0 码力 | 349 页 | 382.34 KB | 1 年前3
peewee Documentation
Release 3.4.0by the atomic() context manager, you can explicitly rollback or commit at any point by calling Transaction.rollback() or Transaction.commit(). When you do this inside a wrapped block of code, a new transaction rror_saving) # Note: no need to call commit. Since this marks the end of the # wrapped block of code, the `atomic` context manager will # automatically call commit for us. Note: atomic() can be used as transac- tion will be started. with db.transaction() as txn: User.create(username='mickey') txn.commit() # Changes are saved and a new transaction begins. User.create(username='huey') # Roll back. "huey"0 码力 | 284 页 | 1.03 MB | 1 年前3
peewee Documentation
Release 3.3.0by the atomic() context manager, you can explicitly rollback or commit at any point by calling Transaction.rollback() or Transaction.commit(). When you do this inside a wrapped block of code, a new transaction rror_saving) # Note: no need to call commit. Since this marks the end of the # wrapped block of code, the `atomic` context manager will # automatically call commit for us. Note: atomic() can be used as transac- tion will be started. with db.transaction() as txn: User.create(username='mickey') txn.commit() # Changes are saved and a new transaction begins. User.create(username='huey') # Roll back. "huey"0 码力 | 280 页 | 1.02 MB | 1 年前3
peewee Documentation Release 3.0.0by the atomic() context manager, you can explicitly rollback or commit at any point by calling Transaction.rollback() or Transaction.commit(). When you do this inside a wrapped block of code, a new transaction ving) # Note: no need to call commit. Since this marks the end of the # wrapped block of code, the `atomic` context manager will # automatically call commit for us. Note atomic() can be used transaction will be started. with db.transaction() as txn: User.create(username='mickey') txn.commit() # Changes are saved and a new transaction begins. User.create(username='huey') # Roll back0 码力 | 319 页 | 361.50 KB | 1 年前3
peewee Documentation Release 3.1.0by the atomic() context manager, you can explicitly rollback or commit at any point by calling Transaction.rollback() or Transaction.commit(). When you do this inside a wrapped block of code, a new transaction aving) # Note: no need to call commit. Since this marks the end of the # wrapped block of code, the `atomic` context manager will # automatically call commit for us. Note atomic() can be used transaction will be started. with db.transaction() as txn: User.create(username='mickey') txn.commit() # Changes are saved and a new transaction begins. User.create(username='huey') # Roll back0 码力 | 332 页 | 370.77 KB | 1 年前3
peewee Documentation
Release 3.5.0by the atomic() context manager, you can explicitly rollback or commit at any point by calling Transaction.rollback() or Transaction.commit(). When you do this inside a wrapped block of code, a new transaction aving) # Note: no need to call commit. Since this marks the end of the # wrapped block of code, the `atomic` context manager will # automatically call commit for us. Note atomic() can be used transaction will be started. with db.transaction() as txn: User.create(username='mickey') txn.commit() # Changes are saved and a new transaction begins. User.create(username='huey') # Roll back0 码力 | 347 页 | 380.80 KB | 1 年前3
peewee Documentation
Release 3.5.0by the atomic() context manager, you can explicitly rollback or commit at any point by calling Transaction.rollback() or Transaction.commit(). When you do this inside a wrapped block of code, a new transaction rror_saving) # Note: no need to call commit. Since this marks the end of the # wrapped block of code, the `atomic` context manager will # automatically call commit for us. Note: atomic() can be used as transac- tion will be started. with db.transaction() as txn: User.create(username='mickey') txn.commit() # Changes are saved and a new transaction begins. User.create(username='huey') # Roll back. "huey"0 码力 | 282 页 | 1.02 MB | 1 年前3
peewee Documentation
Release 2.10.2pp.db', autocommit=False) # You must call begin() db.begin() User.create(username='charlie') db.commit() # If using a transaction, then no changes are necessary. with db.transaction(): User.create(username='huey') sqlite3 driver, psycopg2 or the like. Peewee currently relies on a handful of parts: • Connection.commit • Connection.execute • Connection.rollback • Cursor.description • Cursor.fetchone These methods by the atomic() context manager, you can explicitly rollback or commit at any point by calling Transaction.rollback() or Transaction.commit(). When you do this inside a wrapped block of code, a new transaction0 码力 | 221 页 | 844.06 KB | 1 年前3
peewee Documentation Release 3.6.0by the atomic() context manager, you can explicitly rollback or commit at any point by calling Transaction.rollback() or Transaction.commit(). When you do this inside a wrapped block of code, a new transaction aving) # Note: no need to call commit. Since this marks the end of the # wrapped block of code, the `atomic` context manager will # automatically call commit for us. Note atomic() can be used transaction will be started. with db.transaction() as txn: User.create(username='mickey') txn.commit() # Changes are saved and a new transaction begins. User.create(username='huey') # Roll back0 码力 | 377 页 | 399.12 KB | 1 年前3
peewee Documentation
Release 3.6.0by the atomic() context manager, you can explicitly rollback or commit at any point by calling Transaction.rollback() or Transaction.commit(). When you do this inside a wrapped block of code, a new transaction rror_saving) # Note: no need to call commit. Since this marks the end of the # wrapped block of code, the `atomic` context manager will # automatically call commit for us. Note: atomic() can be used as transac- tion will be started. with db.transaction() as txn: User.create(username='mickey') txn.commit() # Changes are saved and a new transaction begins. User.create(username='huey') # Roll back. "huey"0 码力 | 302 页 | 1.02 MB | 1 年前3
共 16 条
- 1
- 2













