peewee Documentation Release 2.10.2connections you can create an ExecutionContext. Execution contexts allow finer-grained control over managing multiple connections to the database. When an execution context is initialized (either as a context wrapped 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 transaction 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,0 码力 | 275 页 | 276.96 KB | 1 年前3
peewee Documentation
Release 2.10.2if you would like to manually manage multiple connections you can create an ExecutionContext. Execution contexts allow finer-grained control over managing multiple connections to the database. When an wrapped 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 transaction 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 separate0 码力 | 221 页 | 844.06 KB | 1 年前3
peewee Documentation
Release 2.0.2whenever a clause is added that would possibly alter the result set, the query is marked for re-execution. __iter__() Executes the query: >>> for user in User.select().where(User.active == True): .. Return type primary key of the new row Performs the query 1.8.10 RawQuery class RawQuery Allows execution of an arbitrary query and returns instances of the model via a QueryResultsWrapper. __init__(model addition providing support for: 50 Chapter 1. Contents: peewee Documentation, Release 2.0.0 •execution of SQL queries •creating and dropping tables and indexes compiler_class = QueryCompiler A class0 码力 | 65 页 | 315.33 KB | 1 年前3
peewee Documentation Release 1.0.0whenever a clause is added that would possibly alter the result set, the query is marked for re-execution. __iter__() Executes the query: >>> for user in User.select().where(active=True): ... print Return type: primary key of the new row Performs the query RawQuery class RawQuery Allows execution of an arbitrary SELECT query and returns instances of the model via a QueryResultsWrapper. __init__(model wrapper around some of the functions performed by the Adapter, in addition providing support for: execution of SQL queries creating and dropping tables and indexes __init__(adapter, database[, threadlocals=False[0 码力 | 101 页 | 163.20 KB | 1 年前3
peewee Documentation
Release 1.0.0whenever a clause is added that would possibly alter the result set, the query is marked for re-execution. __iter__() Executes the query: >>> for user in User.select().where(active=True): ... print user Return type primary key of the new row Performs the query 1.7.10 RawQuery class RawQuery Allows execution of an arbitrary SELECT query and returns instances of the model via a QueryResultsWrapper. __init__(model wrapper around some of the functions performed by the Adapter, in addition providing support for: •execution of SQL queries •creating and dropping tables and indexes __init__(adapter, database[, threadlocals=False[0 码力 | 71 页 | 405.29 KB | 1 年前3
peewee Documentation Release 0.9.7whenever a clause is added that would possibly alter the result set, the query is marked for re-execution. __iter__() Executes the query: >>> for user in User.select().where(active=True): ... print Return type: primary key of the new row Performs the query RawQuery class RawQuery Allows execution of an arbitrary SELECT query and returns instances of the model via a QueryResultsWrapper. __init__(model wrapper around some of the functions performed by the Adapter, in addition providing support for: execution of SQL queries creating and dropping tables and indexes __init__(adapter, database[, threadlocals=False[0 码力 | 78 页 | 143.68 KB | 1 年前3
peewee Documentation
Release 0.9.7whenever a clause is added that would possibly alter the result set, the query is marked for re-execution. __iter__() Executes the query: >>> for user in User.select().where(active=True): ... print user Return type primary key of the new row Performs the query 1.7.10 RawQuery class RawQuery Allows execution of an arbitrary SELECT query and returns instances of the model via a QueryResultsWrapper. __init__(model wrapper around some of the functions performed by the Adapter, in addition providing support for: •execution of SQL queries •creating and dropping tables and indexes __init__(adapter, database[, threadlocals=False[0 码力 | 53 页 | 347.03 KB | 1 年前3
peewee Documentation Release 3.0.0changed will trigger a DeprecationWarning. Database get_conn() has changed to Database.connection() execution_context() is replaced by simply using the database instance as a context-manager. For a connection database (Database) – Database to execute query against. Bind the query to the given database for execution. dicts([as_dict=True]) as_dict (bool) – Specify whether to return rows as dictionaries. Return you will need to call start() to bring up the worker threads that will do the actual write query execution. @app.before_first_request def _start_worker_threads(): db.start() If you plan on performing0 码力 | 319 页 | 361.50 KB | 1 年前3
peewee Documentation
Release 3.5.0database (Database) – Database to execute query against. Bind the query to the given database for execution. dicts([as_dict=True]) as_dict (bool) – Specify whether to return rows as dictionaries. Return you will need to call start() to bring up the worker threads that will do the actual write query execution. @app.before_first_request def _start_worker_threads(): db.start() If you plan on performing – Optional parameters for the query. commit (bool) – Whether the query should be committed upon execution. A database cursor. Execute the provided query against the database. transaction() Create a0 码力 | 347 页 | 380.80 KB | 1 年前3
peewee Documentation Release 3.4.0get_conn() has changed to Database.connection() get_cursor() has changed to Database.cursor() execution_context() is replaced by simply using the database instance as a context-manager. For a connection database (Database) – Database to execute query against. Bind the query to the given database for execution. dicts([as_dict=True]) as_dict (bool) – Specify whether to return rows as dictionaries. Return you will need to call start() to bring up the worker threads that will do the actual write query execution. @app.before_first_request def _start_worker_threads(): db.start() If you plan on performing0 码力 | 349 页 | 382.34 KB | 1 年前3
共 16 条
- 1
- 2













