peewee Documentation Release 3.5.0
]).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 Note This method should only be used in conjunction with the manual_commit() context manager. batch_commit(it, n) it (iterable) – an iterable whose items will be yielded. n (int) – commit every n items0 码力 | 347 页 | 380.80 KB | 1 年前3peewee Documentation Release 3.4.0
]).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 Note This method should only be used in conjunction with the manual_commit() context manager. batch_commit(it, n) it (iterable) – an iterable whose items will be yielded. n (int) – commit every n items0 码力 | 349 页 | 382.34 KB | 1 年前3peewee Documentation Release 3.5.0
]).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.0 Note: This method should only be used in conjunction with the manual_commit() context manager. batch_commit(it, n) Parameters • it (iterable) – an iterable whose items will be yielded. • n (int) –0 码力 | 282 页 | 1.02 MB | 1 年前3peewee Documentation Release 3.3.0
]).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 when Note: This method should only be used in conjunction with the manual_commit() context manager. batch_commit(it, n) Parameters 118 Chapter 1. Contents: peewee Documentation, Release 3.3.0 • it (iterable)0 码力 | 280 页 | 1.02 MB | 1 年前3peewee Documentation Release 3.4.0
]).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 when Note: This method should only be used in conjunction with the manual_commit() context manager. batch_commit(it, n) Parameters 1.14. API Documentation 119 peewee Documentation, Release 3.4.0 • it0 码力 | 284 页 | 1.03 MB | 1 年前3peewee Documentation Release 3.6.0
]).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 Note This method should only be used in conjunction with the manual_commit() context manager. batch_commit(it, n) Parameters: Returns: Parameters: Returns: Parameters: Returns: Parameters: it0 码力 | 377 页 | 399.12 KB | 1 年前3peewee Documentation Release 3.6.0
]).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 when Note: This method should only be used in conjunction with the manual_commit() context manager. batch_commit(it, n) Parameters • it (iterable) – an iterable whose items will be yielded. • n (int) –0 码力 | 302 页 | 1.02 MB | 1 年前3peewee Documentation Release 2.0.2
classes that controlled access to the database – the Database subclass and an Adapter. The adapter’s job was to say what features a database backend provided, what operations were valid, what column types types were supported, and how to open a connection. The database was a bit higher-level and its main job was to execute queries and provide metadata about the database, like lists of tables, last insert id0 码力 | 65 页 | 315.33 KB | 1 年前3
共 8 条
- 1