peewee Documentation Release 2.10.2records Aggregating records Retrieving Scalar Values SQL Functions, Subqueries and “Raw expressions” Security and SQL Injection Window functions Retrieving raw tuples / dictionaries Returning Clause Query Techniques Avoiding N+1 queries Iterating over lots of rows Speeding up Bulk Inserts Transactions Context manager Decorator Nesting Transactions Explicit transaction Autocommit Mode Playhouse, extensions control over managing multiple connections to the database. When an execution context is initialized (either as a context manager or as a decorated function), a separate connection will be used for the0 码力 | 275 页 | 276.96 KB | 1 年前3
peewee Documentation Release 3.0.0records Aggregating records Retrieving Scalar Values SQL Functions, Subqueries and “Raw expressions” Security and SQL Injection Window functions Retrieving row tuples / dictionaries / namedtuples Returning Techniques Avoiding N+1 queries Iterating over lots of rows Speeding up Bulk Inserts Transactions Context manager Decorator Nesting Transactions Explicit transaction Autocommit Mode Changes in 3.0 Ba thread will only have a single connection open at a given time. Context managers The database object itself can be used as a context-manager, which opens a connection for the duration of the wrapped0 码力 | 319 页 | 361.50 KB | 1 年前3
peewee Documentation Release 3.4.0records Aggregating records Retrieving Scalar Values SQL Functions, Subqueries and “Raw expressions” Security and SQL Injection Window functions Retrieving row tuples / dictionaries / namedtuples Returning Techniques Avoiding N+1 queries Iterating over lots of rows Speeding up Bulk Inserts Transactions Context manager Decorator Nesting Transactions Explicit transaction Autocommit Mode Changes in 3.0 Backwards-incompatible thread will only have a single connection open at a given time. Context managers The database object itself can be used as a context-manager, which opens a connection for the duration of the wrapped0 码力 | 349 页 | 382.34 KB | 1 年前3
peewee Documentation Release 3.1.0records Aggregating records Retrieving Scalar Values SQL Functions, Subqueries and “Raw expressions” Security and SQL Injection Window functions Retrieving row tuples / dictionaries / namedtuples Returning Techniques Avoiding N+1 queries Iterating over lots of rows Speeding up Bulk Inserts Transactions Context manager Decorator Nesting Transactions Explicit transaction Autocommit Mode Changes in 3.0 Backwards-incompatible thread will only have a single connection open at a given time. Context managers The database object itself can be used as a context-manager, which opens a connection for the duration of the wrapped0 码力 | 332 页 | 370.77 KB | 1 年前3
peewee Documentation
Release 3.5.0operators Three valued logic Adding user-defined operators Expressions SQL Functions SQL Helper Security and SQL Injection API Documentation Database Query-builder Fields Schema Manager Model Query-builder thread will only have a single connection open at a given time. Context managers The database object itself can be used as a context-manager, which opens a connection for the duration of the wrapped is open inside context manager. ... False >>> db.is_closed() # db is closed. True If you want to manage transactions separately, you can use the Database.connection_context() context manager. >>> with0 码力 | 347 页 | 380.80 KB | 1 年前3
peewee Documentation Release 3.6.0operators Three valued logic Adding user-defined operators Expressions SQL Functions SQL Helper Security and SQL Injection Relationships and Joins Model definitions Performing simple joins Joining multiple thread will only have a single connection open at a given time. Context managers The database object itself can be used as a context-manager, which opens a connection for the duration of the wrapped is open inside context manager. ... False >>> db.is_closed() # db is closed. True If you want to manage transactions separately, you can use the Database.connection_context() context manager. >>> with0 码力 | 377 页 | 399.12 KB | 1 年前3
peewee Documentation
Release 2.10.2control over managing multiple connections to the database. When an execu- tion context is initialized (either as a context manager or as a decorated function), a separate connection will be used for the block. You can also choose whether to wrap the block in a transaction. Execution context examples: with db.execution_context() as ctx: # A new connection will be opened or, if using a connection pool, # will be committed and the connection # will be closed (or returned to the pool). @db.execution_context(with_transaction=False) def do_something(foo, bar): # When this function is called, a separate connection0 码力 | 221 页 | 844.06 KB | 1 年前3
peewee Documentation
Release 3.3.0thread will only have a single connection open at a given time. Context managers The database object itself can be used as a context-manager, which opens a connection for the duration of the wrapped is open inside context manager. ... False >>> db.is_closed() # db is closed. True If you want to manage transactions separately, you can use the Database.connection_context() context manager. >>> with with db.connection_context(): ... # db connection is open. ... pass ... >>> db.is_closed() # db connection is closed. True The connection_context() method can also be used as a decorator: @db.connection_context()0 码力 | 280 页 | 1.02 MB | 1 年前3
peewee Documentation
Release 3.4.0thread will only have a single connection open at a given time. Context managers The database object itself can be used as a context-manager, which opens a connection for the duration of the wrapped is open inside context manager. ... False >>> db.is_closed() # db is closed. True If you want to manage transactions separately, you can use the Database.connection_context() context manager. >>> with with db.connection_context(): ... # db connection is open. ... pass ... >>> db.is_closed() # db connection is closed. True The connection_context() method can also be used as a decorator: @db.connection_context()0 码力 | 284 页 | 1.03 MB | 1 年前3
peewee Documentation
Release 3.5.0time. 28 Chapter 1. Contents: peewee Documentation, Release 3.5.0 Context managers The database object itself can be used as a context-manager, which opens a connection for the duration of the wrapped is open inside context manager. ... False >>> db.is_closed() # db is closed. True If you want to manage transactions separately, you can use the Database.connection_context() context manager. >>> with with db.connection_context(): ... # db connection is open. ... pass ... >>> db.is_closed() # db connection is closed. True The connection_context() method can also be used as a decorator: @db.connection_context()0 码力 | 282 页 | 1.02 MB | 1 年前3
共 16 条
- 1
- 2













