peewee Documentation Release 2.10.2Existing Databases Adding Request Hooks Additional connection initialization Advanced Connection Management Using multiple databases Database Errors Automatic Reconnect Logging queries Generating skeleton that specifies which database to use. then, any subclasses will automatically # use the correct storage. class BaseModel(Model): class Meta: database = database # the user model specifies its after_request(response): database.close() return response Note Peewee uses thread local storage to manage connection state, so this pattern can be used with multi-threaded WSGI servers. Making0 码力 | 275 页 | 276.96 KB | 1 年前3
peewee Documentation Release 3.0.0using a Database URL Run-time database configuration Dynamically defining a database Connection Management Connection Pooling Framework Integration Executing Queries Managing Transactions Database Errors that specifies which database to use. then, any subclasses will automatically # use the correct storage. class BaseModel(Model): class Meta: database = database # the user model specifies its after_request(response): database.close() return response Note Peewee uses thread local storage to manage connection state, so this pattern can be used with multi-threaded WSGI servers. Making0 码力 | 319 页 | 361.50 KB | 1 年前3
peewee Documentation Release 3.4.0using a Database URL Run-time database configuration Dynamically defining a database Connection Management Connection Pooling Testing Peewee Applications Async with Gevent Framework Integration Executing that specifies which database to use. then, any subclasses will automatically # use the correct storage. class BaseModel(Model): class Meta: database = database # the user model specifies its after_request(response): database.close() return response Note Peewee uses thread local storage to manage connection state, so this pattern can be used with multi-threaded WSGI servers. Making0 码力 | 349 页 | 382.34 KB | 1 年前3
peewee Documentation Release 3.1.0using a Database URL Run-time database configuration Dynamically defining a database Connection Management Connection Pooling Testing Peewee Applications Framework Integration Executing Queries Managing that specifies which database to use. then, any subclasses will automatically # use the correct storage. class BaseModel(Model): class Meta: database = database # the user model specifies its after_request(response): database.close() return response Note Peewee uses thread local storage to manage connection state, so this pattern can be used with multi-threaded WSGI servers. Making0 码力 | 332 页 | 370.77 KB | 1 年前3
peewee Documentation
Release 2.10.2that specifies which database to use. then, any subclasses will automatically # use the correct storage. class BaseModel(Model): class Meta: database = database # the user model specifies its fields after_request def after_request(response): database.close() return response Note: Peewee uses thread local storage to manage connection state, so this pattern can be used with multi-threaded WSGI servers. 1.3. Example see the Adding Request Hooks section. Note: For advanced connection management techniques, see the advanced connection management section. To use this database with your models, set the database attribute0 码力 | 221 页 | 844.06 KB | 1 年前3
peewee Documentation
Release 3.5.0using a Database URL Run-time database configuration Dynamically defining a database Connection Management Connection Pooling Testing Peewee Applications Async with Gevent Framework Integration Executing that specifies which database to use. then, any subclasses will automatically # use the correct storage. class BaseModel(Model): class Meta: database = database # the user model specifies its after_request(response): database.close() return response Note Peewee uses thread local storage to manage connection state, so this pattern can be used with multi-threaded WSGI servers. Making0 码力 | 347 页 | 380.80 KB | 1 年前3
peewee Documentation
Release 3.3.0that specifies which database to use. then, any subclasses will automatically # use the correct storage. class BaseModel(Model): class Meta: database = database # the user model specifies its fields after_request def after_request(response): database.close() return response Note: Peewee uses thread local storage to manage connection state, so this pattern can be used with multi-threaded WSGI servers. Making instead use Database.init(). See Run-time database configuration for more details. 1.6.8 Connection Management To open a connection to a database, use the Database.connect() method: >>> db = SqliteDatabase(':memory:')0 码力 | 280 页 | 1.02 MB | 1 年前3
peewee Documentation
Release 3.4.0that specifies which database to use. then, any subclasses will automatically # use the correct storage. class BaseModel(Model): class Meta: database = database # the user model specifies its fields after_request def after_request(response): database.close() return response Note: Peewee uses thread local storage to manage connection state, so this pattern can be used with multi-threaded WSGI servers. Making configuration for more details. 1.6. Database 47 peewee Documentation, Release 3.4.0 1.6.8 Connection Management To open a connection to a database, use the Database.connect() method: >>> db = SqliteDatabase(':memory:')0 码力 | 284 页 | 1.03 MB | 1 年前3
peewee Documentation Release 3.6.0using a Database URL Run-time database configuration Dynamically defining a database Connection Management Connection Pooling Testing Peewee Applications Async with Gevent Framework Integration Executing that specifies which database to use. then, any subclasses will automatically # use the correct storage. class BaseModel(Model): class Meta: database = database # the user model specifies its after_request(response): database.close() return response Note Peewee uses thread local storage to manage connection state, so this pattern can be used with multi-threaded WSGI servers. Making0 码力 | 377 页 | 399.12 KB | 1 年前3
peewee Documentation
Release 3.5.0that specifies which database to use. then, any subclasses will automatically # use the correct storage. class BaseModel(Model): class Meta: database = database # the user model specifies its fields after_request def after_request(response): database.close() return response Note: Peewee uses thread local storage to manage connection state, so this pattern can be used with multi-threaded WSGI servers. Making instead use Database.init(). See Run-time database configuration for more details. 1.5.8 Connection Management To open a connection to a database, use the Database.connect() method: >>> db = SqliteDatabase(':memory:')0 码力 | 282 页 | 1.02 MB | 1 年前3
共 16 条
- 1
- 2













