Create a new AsyncEngine instance using a configuration dictionary. This function is analogous to the :func:`_sa.engine_from_config` function in SQLAlchemy Core, except that the requested dialect must be an asyncio-compatible dialect such as :ref:`dialect-postgresql-asyncpg`. The ar
(
configuration: Dict[str, Any], prefix: str = "sqlalchemy.", **kwargs: Any
)
| 128 | |
| 129 | |
| 130 | def async_engine_from_config( |
| 131 | configuration: Dict[str, Any], prefix: str = "sqlalchemy.", **kwargs: Any |
| 132 | ) -> AsyncEngine: |
| 133 | """Create a new AsyncEngine instance using a configuration dictionary. |
| 134 | |
| 135 | This function is analogous to the :func:`_sa.engine_from_config` function |
| 136 | in SQLAlchemy Core, except that the requested dialect must be an |
| 137 | asyncio-compatible dialect such as :ref:`dialect-postgresql-asyncpg`. |
| 138 | The argument signature of the function is identical to that |
| 139 | of :func:`_sa.engine_from_config`. |
| 140 | |
| 141 | .. versionadded:: 1.4.29 |
| 142 | |
| 143 | """ |
| 144 | options = { |
| 145 | key[len(prefix) :]: value |
| 146 | for key, value in configuration.items() |
| 147 | if key.startswith(prefix) |
| 148 | } |
| 149 | options["_coerce_config"] = True |
| 150 | options.update(kwargs) |
| 151 | url = options.pop("url") |
| 152 | return create_async_engine(url, **options) |
| 153 | |
| 154 | |
| 155 | def create_async_pool_from_url(url: Union[str, URL], **kwargs: Any) -> Pool: |