Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

gino-quart

test

Introduction

An extension for GINO to support quart server.

Usage

The common usage looks like this:

from quart import Quart
from gino.ext.quart import Gino

app = Quart()
db = Gino(app, **kwargs)

Configuration

GINO adds a before_request, after_request and before_first_request hook to the Quart app to setup and cleanup database according to the configurations that passed in the kwargs parameter.

The config includes:

Name Description Default
driver the database driver asyncpg
host database server host localhost
port database server port 5432
user database server user postgres
password database server password empty
database database name postgres
dsn a SQLAlchemy database URL to create the engine, its existence will replace all previous connect arguments. N/A
retry_times the retry times when database failed to connect 20
retry_interval the interval in seconds between each time of retry 5
pool_min_size the initial number of connections of the db pool. N/A
pool_max_size the maximum number of connections in the db pool. N/A
echo enable SQLAlchemy echo mode. N/A
ssl SSL context passed to asyncpg.connect None
use_connection_for_request flag to set up lazy connection for requests. N/A
retry_limit the number of retries to connect to the database on start up. 1
retry_interval seconds to wait between retries. 1
kwargs other parameters passed to the specified dialects, like asyncpg. Unrecognized parameters will cause exceptions. N/A

Lazy Connection

If use_connection_for_request is set to be True, then a lazy connection is available at request['connection']. By default, a database connection is borrowed on the first query, shared in the same execution context, and returned to the pool on response. If you need to release the connection early in the middle to do some long-running tasks, you can simply do this:

await request['connection'].release(permanent=False)

Contributing

You're welcome to contribute to this project. It's really appreciated. Please fork this project and create a pull request to the dev branch.

  • Dependency management is done via poetry
  • Pull request for new features must include the appropriate tests integrated in tests/test_gino_quart.py
  • You should format your code. Recommended is black

Attribution

The license holder of this extension is Tony Wang.

This project is an extension to GINO and part of the python-gino community.

Release files for gino-quart 0.1.1b4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gino-quart 0.1.1b4
File Size Uploaded
gino-quart-0.1.1b4.tar.gz 5.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gino-quart 0.1.1b4
File Interpreter ABI Platform
gino_quart-0.1.1b4-py3-none-any.whl Python 3 none any Details

Total release size: 10.7 kB

Release files / gino-quart-0.1.1b4.tar.gz

Download URL gino-quart-0.1.1b4.tar.gz
Size 5.3 kB
Tags Source
SHA-256 checksum
How to use checksums
ecb8556a90d2a0c695523bc7bc8400473bac83bd3410e9b86e65d902f256e0d3
BLAKE2b-256 checksum
How to use checksums
cc5032d65e78c49dece02698b07cefec8871583fb918bc8d22ace652e656ed0e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.5 CPython/3.8.8 Linux/5.4.0-1040-azure

Release files / gino_quart-0.1.1b4-py3-none-any.whl

Download URL gino_quart-0.1.1b4-py3-none-any.whl
Size 5.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
70366eb9df912f59d7125f891888d2ae32c66f530726016364872e5753cdc56f
BLAKE2b-256 checksum
How to use checksums
6efa584c9698328e1fa9a51ced236d8720fb78dc97d1d46b7f1e9d7d0c3f94af
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.5 CPython/3.8.8 Linux/5.4.0-1040-azure
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page