peewee Documentation Release 3.5.0
database.connect() # This hook ensures that the connection is closed when we've finished # processing the request. @app.teardown_request def _db_close(exc): if not database.is_closed(): ]).execute() If Model.insert_many() won’t work for your use-case, you can also use the Database.batch_commit() helper to process chunks of rows inside transactions: # List of row data to insert. row_data The following code will result in # 8 total transactions (7x100 rows + 1x89 rows). for row in db.batch_commit(row_data, 100): User.create(**row) Note SQLite users should be aware of some caveats0 码力 | 347 页 | 380.80 KB | 1 年前3peewee Documentation Release 3.4.0
database.connect() # This hook ensures that the connection is closed when we've finished # processing the request. @app.teardown_request def _db_close(exc): if not database.is_closed(): ]).execute() If Model.insert_many() won’t work for your use-case, you can also use the Database.batch_commit() helper to process chunks of rows inside transactions: # List of row data to insert. row_data The following code will result in # 8 total transactions (7x100 rows + 1x89 rows). for row in db.batch_commit(row_data, 100): User.create(**row) Note SQLite users should be aware of some caveats0 码力 | 349 页 | 382.34 KB | 1 年前3peewee Documentation Release 3.5.0
_db_connect(): database.connect() # This hook ensures that the connection is closed when we've finished # processing the request. @app.teardown_request def _db_close(exc): if not database.is_closed(): database.close() ]).execute() If Model.insert_many() won’t work for your use-case, you can also use the Database.batch_commit() helper to process chunks of rows inside transactions: # List of row data to insert. row_data The following code will result in # 8 total transactions (7x100 rows + 1x89 rows). for row in db.batch_commit(row_data, 100): User.create(**row) 1.7. Querying 61 peewee Documentation, Release 3.5.00 码力 | 282 页 | 1.02 MB | 1 年前3peewee Documentation Release 3.3.0
_db_connect(): database.connect() # This hook ensures that the connection is closed when we've finished # processing the request. @app.teardown_request def _db_close(exc): if not database.is_closed(): database.close() ]).execute() If Model.insert_many() won’t work for your use-case, you can also use the Database.batch_commit() helper to process chunks of rows inside transactions: # List of row data to insert. row_data The following code will result in # 8 total transactions (7x100 rows + 1x89 rows). for row in db.batch_commit(row_data, 100): User.create(**row) Note: SQLite users should be aware of some caveats when0 码力 | 280 页 | 1.02 MB | 1 年前3peewee Documentation Release 3.4.0
_db_connect(): database.connect() # This hook ensures that the connection is closed when we've finished # processing the request. @app.teardown_request def _db_close(exc): if not database.is_closed(): database.close() ]).execute() If Model.insert_many() won’t work for your use-case, you can also use the Database.batch_commit() helper to process chunks of rows inside transactions: # List of row data to insert. row_data The following code will result in # 8 total transactions (7x100 rows + 1x89 rows). for row in db.batch_commit(row_data, 100): User.create(**row) Note: SQLite users should be aware of some caveats when0 码力 | 284 页 | 1.03 MB | 1 年前3peewee Documentation Release 3.6.0
database.connect() # This hook ensures that the connection is closed when we've finished # processing the request. @app.teardown_request def _db_close(exc): if not database.is_closed(): ]).execute() If Model.insert_many() won’t work for your use-case, you can also use the Database.batch_commit() helper to process chunks of rows inside transactions: # List of row data to insert. row_data The following code will result in # 8 total transactions (7x100 rows + 1x89 rows). for row in db.batch_commit(row_data, 100): User.create(**row) Note SQLite users should be aware of some caveats0 码力 | 377 页 | 399.12 KB | 1 年前3peewee Documentation Release 3.6.0
_db_connect(): database.connect() # This hook ensures that the connection is closed when we've finished # processing the request. @app.teardown_request def _db_close(exc): if not database.is_closed(): database.close() ]).execute() If Model.insert_many() won’t work for your use-case, you can also use the Database.batch_commit() helper to process chunks of rows inside transactions: # List of row data to insert. row_data The following code will result in # 8 total transactions (7x100 rows + 1x89 rows). for row in db.batch_commit(row_data, 100): User.create(**row) Note: SQLite users should be aware of some caveats when0 码力 | 302 页 | 1.02 MB | 1 年前3peewee Documentation Release 2.10.2
database.connect() # This hook ensures that the connection is closed when we've finished # processing the request. @app.teardown_request def _db_close(exc): if not database.is_closed():0 码力 | 275 页 | 276.96 KB | 1 年前3peewee Documentation Release 2.10.2
_db_connect(): database.connect() # This hook ensures that the connection is closed when we've finished # processing the request. @app.teardown_request def _db_close(exc): if not database.is_closed(): database.close()0 码力 | 221 页 | 844.06 KB | 1 年前3peewee Documentation Release 3.0.0
database.connect() # This hook ensures that the connection is closed when we've finished # processing the request. @app.teardown_request def _db_close(exc): if not database.is_closed():0 码力 | 319 页 | 361.50 KB | 1 年前3
共 11 条
- 1
- 2