Skip to content

Commit

Permalink
Deploying to gh-pages from @ litestar-org/litestar@da30d9f 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
cofin committed Jan 5, 2025
1 parent 0074ad6 commit 19c490b
Show file tree
Hide file tree
Showing 259 changed files with 15,104 additions and 3,326 deletions.
2 changes: 1 addition & 1 deletion 3803/.buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: ab56542bf2c95d177c2041da7acd3746
config: c4c876f80fdbc557678f6722246a88fc
tags: 645f666f9bcd5a90fca523b33c5a78b7
7 changes: 5 additions & 2 deletions 3803/_sources/admonitions/sync-to-thread-info.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@
running the event loop, and in turn block the whole application.

To mitigate this, the ``sync_to_thread`` parameter can be set to ``True``, which
will result in the function being run in a thread pool. Should the function be
non-blocking, ``sync_to_thread`` should be set to ``False`` instead.
will result in the function being run in a thread pool.

If a synchronous function is non-blocking, setting ``sync_to_thread`` to ``False``
will tell Litestar that the user is sure about its behavior
and the function can be treated as non-blocking.

If a synchronous function is passed, without setting an explicit ``sync_to_thread``
value, a warning will be raised.
Expand Down
6 changes: 0 additions & 6 deletions 3803/_sources/index.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,6 @@ A huge thank you to our current sponsors:
</a>
<p style="text-align: center;">Telemetry Sports</p>
</div>
<div>
<a href="https://www.stok.kr/" title="Stok - Stack Up Your Assets!">
<img src="https://avatars.githubusercontent.com/u/144093421?s=400&v=4" alt="Stok" style="border-radius: 10px; width: auto; max-height: 150px;" />
</a>
<p style="text-align: center;">Stok</p>
</div>
</div>

We invite organizations and individuals to join our sponsorship program.
Expand Down
5 changes: 5 additions & 0 deletions 3803/_sources/reference/plugins/attrs.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
attrs
=====

.. automodule:: litestar.plugins.attrs
:members:
7 changes: 7 additions & 0 deletions 3803/_sources/reference/plugins/htmx.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
====
htmx
====


.. automodule:: litestar.plugins.htmx
:members:
4 changes: 4 additions & 0 deletions 3803/_sources/reference/plugins/index.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ plugins
:maxdepth: 1
:hidden:

attrs
flash_messages
htmx
problem_details
prometheus
pydantic
structlog
sqlalchemy
5 changes: 5 additions & 0 deletions 3803/_sources/reference/plugins/prometheus.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
prometheus
==========

.. automodule:: litestar.plugins.prometheus
:members:
5 changes: 5 additions & 0 deletions 3803/_sources/reference/plugins/pydantic.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pydantic
========

.. automodule:: litestar.plugins.pydantic
:members:
1 change: 1 addition & 0 deletions 3803/_sources/reference/stores/index.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ stores
memory
redis
registry
valkey
5 changes: 5 additions & 0 deletions 3803/_sources/reference/stores/valkey.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
valkey
======

.. automodule:: litestar.stores.valkey
:members:
2 changes: 1 addition & 1 deletion 3803/_sources/reference/testing.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ testing


.. automodule:: litestar.testing
:members: RequestFactory, BaseTestClient, TestClient, AsyncTestClient, create_async_test_client, create_test_client
:members: RequestFactory, BaseTestClient, TestClient, AsyncTestClient, create_async_test_client, create_test_client, subprocess_sync_client, subprocess_async_client
:undoc-members: WebSocketTestSession


Expand Down
12 changes: 6 additions & 6 deletions 3803/_sources/reference/types.rst.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
types
=====

.. py:currentmodule:: litestar.types
.. module:: litestar.types



Expand Down Expand Up @@ -58,15 +58,15 @@ ASGI Application Parameters
ASGI Scopes
~~~~~~~~~~~~

.. autodata:: litestar.types.ASGIVersion
.. autoclass:: litestar.types.ASGIVersion

.. autodata:: litestar.types.BaseScope
.. autoclass:: litestar.types.BaseScope

.. autodata:: litestar.types.HTTPScope
.. autoclass:: litestar.types.HTTPScope

.. autodata:: litestar.types.LifeSpanScope
.. autoclass:: litestar.types.LifeSpanScope

.. autodata:: litestar.types.WebSocketScope
.. autoclass:: litestar.types.WebSocketScope


ASGI Events
Expand Down
110 changes: 110 additions & 0 deletions 3803/_sources/release-notes/changelog.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,116 @@
=============


.. changelog:: 2.13.0
:date: 2024-11-20

.. change:: Add ``request_max_body_size`` layered parameter
:type: feature

Add a new ``request_max_body_size`` layered parameter, which limits the
maximum size of a request body before returning a ``413 - Request Entity Too Large``.

.. seealso::
:ref:`usage/requests:limits`


.. change:: Send CSRF request header in OpenAPI plugins
:type: feature
:pr: 3754

Supported OpenAPI UI clients will extract the CSRF cookie value and attach it to
the request headers if CSRF is enabled on the application.

.. change:: deprecate `litestar.contrib.sqlalchemy`
:type: feature
:pr: 3755

Deprecate the ``litestar.contrib.sqlalchemy`` module in favor of ``litestar.plugins.sqlalchemy``


.. change:: implement `HTMX` plugin using `litestar-htmx`
:type: feature
:pr: 3837

This plugin migrates the HTMX integration to ``litestar.plugins.htmx``.

This logic has been moved to it's own repository named ``litestar-htmx``

.. change:: Pydantic: honor ``hide_input_in_errors`` in throwing validation exceptions
:type: feature
:pr: 3843

Pydantic's ``BaseModel`` supports configuration to hide data values when
throwing exceptions, via setting ``hide_input_in_errors`` -- see
https://docs.pydantic.dev/2.0/api/config/#pydantic.config.ConfigDict.hide_input_in_errors
and https://docs.pydantic.dev/latest/usage/model_config/#hide-input-in-errors

Litestar will now honour this setting

.. change:: deprecate``litestar.contrib.pydantic``
:type: feature
:pr: 3852
:issue: 3787

## Description

Deprecate ``litestar.contrib.pydantic`` in favor of ``litestar.plugins.pydantic``


.. change:: Fix sign bug in rate limit middelware
:type: bugfix
:pr: 3776

Fix a bug in the rate limit middleware, that would cause the response header
fields ``RateLimit-Remaining`` and ``RateLimit-Reset`` to have negative values.


.. change:: OpenAPI: map JSONSchema spec naming convention to snake_case when names from ``schema_extra`` are not found
:type: bugfix
:pr: 3767
:issue: 3766

Address rejection of ``schema_extra`` values using JSONSchema spec-compliant
key names by mapping between the relevant naming conventions.

.. change:: Use correct path template for routes without path parameters
:type: bugfix
:pr: 3784

Fix a but where, when using ``PrometheusConfig.group_path=True``, the metrics
exporter response content would ignore all paths with no path parameters.

.. change:: Fix a dangling anyio stream in ``TestClient``
:type: bugfix
:pr: 3836
:issue: 3834

Fix a dangling anyio stream in ``TestClient`` that would cause a resource warning

Closes #3834.

.. change:: Fix bug in handling of missing ``more_body`` key in ASGI response
:type: bugfix
:pr: 3845

Some frameworks do not include the ``more_body`` key in the "http.response.body" ASGI event.
According to the ASGI specification, this key should be set to ``False`` when
there is no additional body content. Litestar expects ``more_body`` to be
explicitly defined, but others might not.

This leads to failures when an ASGI framework mounted on Litestar throws error
if this key is missing.


.. change:: Fix duplicate ``RateLimit-*`` headers with caching
:type: bugfix
:pr: 3855
:issue: 3625

Fix a bug where ``RateLimitMiddleware`` duplicate all ``RateLimit-*`` headers
when handler cache is enabled.


.. changelog:: 2.12.1
:date: 2024-09-21

Expand Down
2 changes: 1 addition & 1 deletion 3803/_sources/topics/sync-vs-async.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ When to use a synchronous function
----------------------------------

As an inverse of the previous paragraph, it follows that synchronous functions should
be used for non-blocking, non-computationally intensive tasks. The synchronous execution
be used for non-io intensive tasks. The synchronous execution
model allows for the smallest amount of overhead and should therefore be preferred in
such situations where no asynchronous functionality is made use of.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ Additional features provided by the built-in base models include:
reverts to an ``Integer`` for unsupported variants.
- A custom :class:`JsonB <advanced_alchemy.types.JsonB>` type that uses
native ``JSONB`` where possible and ``Binary`` or ``Blob`` as an alternative.
- A custom :class:`EncryptedString <advanced_alchemy.types.EncryptedString>` encrypted string that supports multiple cryptography backends.

Let's build on this as we look at the repository classes.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ engine and session lifecycle, and register our ``transaction`` dependency.
.. literalinclude:: /examples/contrib/sqlalchemy/plugins/tutorial/full_app_with_plugin.py
:language: python
:linenos:
:lines: 80-84
:lines: 80-83

.. seealso::

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
SQLAlchemy Init Plugin
----------------------

The :class:`SQLAlchemyInitPlugin <advanced_alchemy.extensions.litestar.plugins.SQLAlchemyInitPlugin>` adds functionality to the
The :class:`SQLAlchemyInitPlugin <advanced_alchemy.extensions.litestar.SQLAlchemyInitPlugin>` adds functionality to the
application that supports using Litestar with `SQLAlchemy <http://www.sqlalchemy.org/>`_.

The plugin:
Expand Down Expand Up @@ -39,8 +39,8 @@ Renaming the dependencies
#########################

You can change the name that the engine and session are bound to by setting the
:attr:`engine_dependency_key <advanced_alchemy.extensions.litestar.plugins.init.config.asyncio.SQLAlchemyAsyncConfig.engine_dependency_key>`
and :attr:`session_dependency_key <advanced_alchemy.extensions.litestar.plugins.init.config.asyncio.SQLAlchemyAsyncConfig.session_dependency_key>`
:attr:`engine_dependency_key <advanced_alchemy.extensions.litestar.SQLAlchemyAsyncConfig.engine_dependency_key>`
and :attr:`session_dependency_key <advanced_alchemy.extensions.litestar.SQLAlchemyAsyncConfig.session_dependency_key>`
attributes on the plugin configuration.

Configuring the before send handler
Expand All @@ -50,7 +50,7 @@ The plugin configures a ``before_send`` handler that is called before sending a
session and removes it from the connection scope.

You can change the handler by setting the
:attr:`before_send_handler <advanced_alchemy.extensions.litestar.plugins.init.config.asyncio.SQLAlchemyAsyncConfig.before_send_handler>`
:attr:`before_send_handler <advanced_alchemy.extensions.litestar.SQLAlchemyAsyncConfig.before_send_handler>`
attribute on the configuration object. For example, an alternate handler is available that will also commit the session
on success and rollback upon failure.

Expand All @@ -73,21 +73,21 @@ on success and rollback upon failure.
Configuring the plugins
#######################

Both the :class:`SQLAlchemyAsyncConfig <advanced_alchemy.extensions.litestar.config.SQLAlchemyAsyncConfig>` and the
:class:`SQLAlchemySyncConfig <advanced_alchemy.extensions.litestar.config.SQLAlchemySyncConfig>` have an ``engine_config``
Both the :class:`SQLAlchemyAsyncConfig <advanced_alchemy.extensions.litestar.SQLAlchemyAsyncConfig>` and the
:class:`SQLAlchemySyncConfig <advanced_alchemy.extensions.litestar.SQLAlchemySyncConfig>` have an ``engine_config``
attribute that is used to configure the engine. The ``engine_config`` attribute is an instance of
:class:`EngineConfig <advanced_alchemy.config.EngineConfig>` and exposes all of the configuration options
:class:`EngineConfig <advanced_alchemy.extensions.litestar.EngineConfig>` and exposes all of the configuration options
available to the SQLAlchemy engine.

The :class:`SQLAlchemyAsyncConfig <advanced_alchemy.extensions.litestar.config.SQLAlchemyAsyncConfig>` class and the
:class:`SQLAlchemySyncConfig <advanced_alchemy.extensions.litestar.config.SQLAlchemySyncConfig>` class also have a
The :class:`SQLAlchemyAsyncConfig <advanced_alchemy.extensions.litestar.SQLAlchemyAsyncConfig>` class and the
:class:`SQLAlchemySyncConfig <advanced_alchemy.extensions.litestar.SQLAlchemySyncConfig>` class also have a
``session_config`` attribute that is used to configure the session. This is either an instance of
:class:`AsyncSessionConfig <advanced_alchemy.config.AsyncSessionConfig>` or
:class:`SyncSessionConfig <advanced_alchemy.config.SyncSessionConfig>` depending on the type of config
:class:`AsyncSessionConfig <advanced_alchemy.extensions.litestar.AsyncSessionConfig>` or
:class:`SyncSessionConfig <advanced_alchemy.extensions.litestar.SyncSessionConfig>` depending on the type of config
object. These classes expose all of the configuration options available to the SQLAlchemy session.

Finally, the :class:`SQLAlchemyAsyncConfig <advanced_alchemy.extensions.litestar.config.SQLAlchemyAsyncConfig>` class and the
:class:`SQLAlchemySyncConfig <advanced_alchemy.extensions.litestar.config.SQLAlchemySyncConfig>` class expose configuration
Finally, the :class:`SQLAlchemyAsyncConfig <advanced_alchemy.extensions.litestar.SQLAlchemyAsyncConfig>` class and the
:class:`SQLAlchemySyncConfig <advanced_alchemy.extensions.litestar.SQLAlchemySyncConfig>` class expose configuration
options to control their behavior.

Consult the reference documentation for more information.
Expand All @@ -98,7 +98,7 @@ Example
The below example is a complete demonstration of use of the init plugin. Readers who are familiar with the prior section
may note the additional complexity involved in managing the conversion to and from SQLAlchemy objects within the
handlers. Read on to see how this increased complexity is efficiently handled by the
:class:`SQLAlchemySerializationPlugin <advanced_alchemy.extensions.litestar.plugins.SQLAlchemySerializationPlugin>`.
:class:`SQLAlchemySerializationPlugin <advanced_alchemy.extensions.litestar.SQLAlchemySerializationPlugin>`.

.. tab-set::

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
SQLAlchemy Plugin
-----------------

The :class:`SQLAlchemyPlugin <advanced_alchemy.extensions.litestar.plugins.SQLAlchemyPlugin>` provides complete support for
The :class:`SQLAlchemyPlugin <advanced_alchemy.extensions.litestar.SQLAlchemyPlugin>` provides complete support for
working with `SQLAlchemy <https://www.sqlalchemy.org/>`_ in Litestar applications.

.. note::

This plugin is only compatible with SQLAlchemy 2.0+.

The :class:`SQLAlchemyPlugin <advanced_alchemy.extensions.litestar.plugins.SQLAlchemyPlugin>` combines the functionality of
:class:`SQLAlchemyInitPlugin <advanced_alchemy.extensions.litestar.plugins.SQLAlchemyInitPlugin>` and
:class:`SQLAlchemySerializationPlugin <advanced_alchemy.extensions.litestar.plugins.SQLAlchemySerializationPlugin>`, each of
The :class:`SQLAlchemyPlugin <advanced_alchemy.extensions.litestar.SQLAlchemyPlugin>` combines the functionality of
:class:`SQLAlchemyInitPlugin <advanced_alchemy.extensions.litestar.SQLAlchemyInitPlugin>` and
:class:`SQLAlchemySerializationPlugin <advanced_alchemy.extensions.litestar.SQLAlchemySerializationPlugin>`, each of
which are examined in detail in the following sections. As such, this section describes a complete example of using the
:class:`SQLAlchemyPlugin <advanced_alchemy.extensions.litestar.plugins.SQLAlchemyPlugin>` with a Litestar application and a
:class:`SQLAlchemyPlugin <advanced_alchemy.extensions.litestar.SQLAlchemyPlugin>` with a Litestar application and a
SQLite database.

Or, skip ahead to :doc:`/usage/databases/sqlalchemy/plugins/sqlalchemy_init_plugin` or
Expand Down
Loading

0 comments on commit 19c490b

Please sign in to comment.