We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
StaticFilesConfig and virtual directories
I'm trying to write a ``FileSystemProtocol`` to load files from the package data using [importlib_resources](https://importlib-resources.readthedocs.io/en/latest/using.html#). But because ``directories`` is defined as ``DirectoryPath``, pydantic checks if the given directories exist in the local filesystem. 

This is not generally true, especially in any kind of virtual filesystem (e.g. a zipped package). I think this condition should be relaxed to support virtual filesystems.

https://github.com/starlite-api/starlite/blob/9bb6dcd57c10a591377cf8e3a537e9292566d5b9/starlite/config/static_files.py#L32

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `litestar/contrib/sqlalchemy/plugins/__init__.py`
Content:
```
1 from __future__ import annotations
2 
3 from .init import (
4     AsyncSessionConfig,
5     EngineConfig,
6     GenericSessionConfig,
7     GenericSQLAlchemyConfig,
8     SQLAlchemyAsyncConfig,
9     SQLAlchemyInitPlugin,
10     SQLAlchemySyncConfig,
11     SyncSessionConfig,
12 )
13 from .serialization import SQLAlchemySerializationPlugin
14 
15 
16 class SQLAlchemyPlugin(SQLAlchemyInitPlugin, SQLAlchemySerializationPlugin):
17     """A plugin that provides SQLAlchemy integration."""
18 
19     def __init__(self, config: SQLAlchemyAsyncConfig | SQLAlchemySyncConfig) -> None:
20         SQLAlchemyInitPlugin.__init__(self, config=config)
21         SQLAlchemySerializationPlugin.__init__(self)
22 
23 
24 __all__ = (
25     "AsyncSessionConfig",
26     "EngineConfig",
27     "GenericSQLAlchemyConfig",
28     "GenericSessionConfig",
29     "SQLAlchemyAsyncConfig",
30     "SQLAlchemyInitPlugin",
31     "SQLAlchemyPlugin",
32     "SQLAlchemySerializationPlugin",
33     "SQLAlchemySyncConfig",
34     "SyncSessionConfig",
35 )
36
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/litestar/contrib/sqlalchemy/plugins/__init__.py b/litestar/contrib/sqlalchemy/plugins/__init__.py
--- a/litestar/contrib/sqlalchemy/plugins/__init__.py
+++ b/litestar/contrib/sqlalchemy/plugins/__init__.py
@@ -1,5 +1,10 @@
 from __future__ import annotations
 
+from typing import TYPE_CHECKING
+
+from litestar.contrib.sqlalchemy.plugins import _slots_base
+from litestar.plugins import InitPluginProtocol
+
 from .init import (
     AsyncSessionConfig,
     EngineConfig,
@@ -12,13 +17,29 @@
 )
 from .serialization import SQLAlchemySerializationPlugin
 
+if TYPE_CHECKING:
+    from litestar.config.app import AppConfig
+
 
-class SQLAlchemyPlugin(SQLAlchemyInitPlugin, SQLAlchemySerializationPlugin):
+class SQLAlchemyPlugin(InitPluginProtocol, _slots_base.SlotsBase):
     """A plugin that provides SQLAlchemy integration."""
 
     def __init__(self, config: SQLAlchemyAsyncConfig | SQLAlchemySyncConfig) -> None:
-        SQLAlchemyInitPlugin.__init__(self, config=config)
-        SQLAlchemySerializationPlugin.__init__(self)
+        """Initialize ``SQLAlchemyPlugin``.
+
+        Args:
+            config: configure DB connection and hook handlers and dependencies.
+        """
+        self._config = config
+
+    def on_app_init(self, app_config: AppConfig) -> AppConfig:
+        """Configure application for use with SQLAlchemy.
+
+        Args:
+            app_config: The :class:`AppConfig <.config.app.AppConfig>` instance.
+        """
+        app_config.plugins.extend([SQLAlchemyInitPlugin(config=self._config), SQLAlchemySerializationPlugin()])
+        return app_config
 
 
 __all__ = (

{"golden_diff": "diff --git a/litestar/contrib/sqlalchemy/plugins/__init__.py b/litestar/contrib/sqlalchemy/plugins/__init__.py\n--- a/litestar/contrib/sqlalchemy/plugins/__init__.py\n+++ b/litestar/contrib/sqlalchemy/plugins/__init__.py\n@@ -1,5 +1,10 @@\n from __future__ import annotations\n \n+from typing import TYPE_CHECKING\n+\n+from litestar.contrib.sqlalchemy.plugins import _slots_base\n+from litestar.plugins import InitPluginProtocol\n+\n from .init import (\n     AsyncSessionConfig,\n     EngineConfig,\n@@ -12,13 +17,29 @@\n )\n from .serialization import SQLAlchemySerializationPlugin\n \n+if TYPE_CHECKING:\n+    from litestar.config.app import AppConfig\n+\n \n-class SQLAlchemyPlugin(SQLAlchemyInitPlugin, SQLAlchemySerializationPlugin):\n+class SQLAlchemyPlugin(InitPluginProtocol, _slots_base.SlotsBase):\n     \"\"\"A plugin that provides SQLAlchemy integration.\"\"\"\n \n     def __init__(self, config: SQLAlchemyAsyncConfig | SQLAlchemySyncConfig) -> None:\n-        SQLAlchemyInitPlugin.__init__(self, config=config)\n-        SQLAlchemySerializationPlugin.__init__(self)\n+        \"\"\"Initialize ``SQLAlchemyPlugin``.\n+\n+        Args:\n+            config: configure DB connection and hook handlers and dependencies.\n+        \"\"\"\n+        self._config = config\n+\n+    def on_app_init(self, app_config: AppConfig) -> AppConfig:\n+        \"\"\"Configure application for use with SQLAlchemy.\n+\n+        Args:\n+            app_config: The :class:`AppConfig <.config.app.AppConfig>` instance.\n+        \"\"\"\n+        app_config.plugins.extend([SQLAlchemyInitPlugin(config=self._config), SQLAlchemySerializationPlugin()])\n+        return app_config\n \n \n __all__ = (\n", "issue": "StaticFilesConfig and virtual directories\nI'm trying to write a ``FileSystemProtocol`` to load files from the package data using [importlib_resources](https://importlib-resources.readthedocs.io/en/latest/using.html#). But because ``directories`` is defined as ``DirectoryPath``, pydantic checks if the given directories exist in the local filesystem. \r\n\r\nThis is not generally true, especially in any kind of virtual filesystem (e.g. a zipped package). I think this condition should be relaxed to support virtual filesystems.\r\n\r\nhttps://github.com/starlite-api/starlite/blob/9bb6dcd57c10a591377cf8e3a537e9292566d5b9/starlite/config/static_files.py#L32\n", "before_files": [{"content": "from __future__ import annotations\n\nfrom .init import (\n    AsyncSessionConfig,\n    EngineConfig,\n    GenericSessionConfig,\n    GenericSQLAlchemyConfig,\n    SQLAlchemyAsyncConfig,\n    SQLAlchemyInitPlugin,\n    SQLAlchemySyncConfig,\n    SyncSessionConfig,\n)\nfrom .serialization import SQLAlchemySerializationPlugin\n\n\nclass SQLAlchemyPlugin(SQLAlchemyInitPlugin, SQLAlchemySerializationPlugin):\n    \"\"\"A plugin that provides SQLAlchemy integration.\"\"\"\n\n    def __init__(self, config: SQLAlchemyAsyncConfig | SQLAlchemySyncConfig) -> None:\n        SQLAlchemyInitPlugin.__init__(self, config=config)\n        SQLAlchemySerializationPlugin.__init__(self)\n\n\n__all__ = (\n    \"AsyncSessionConfig\",\n    \"EngineConfig\",\n    \"GenericSQLAlchemyConfig\",\n    \"GenericSessionConfig\",\n    \"SQLAlchemyAsyncConfig\",\n    \"SQLAlchemyInitPlugin\",\n    \"SQLAlchemyPlugin\",\n    \"SQLAlchemySerializationPlugin\",\n    \"SQLAlchemySyncConfig\",\n    \"SyncSessionConfig\",\n)\n", "path": "litestar/contrib/sqlalchemy/plugins/__init__.py"}], "after_files": [{"content": "from __future__ import annotations\n\nfrom typing import TYPE_CHECKING\n\nfrom litestar.contrib.sqlalchemy.plugins import _slots_base\nfrom litestar.plugins import InitPluginProtocol\n\nfrom .init import (\n    AsyncSessionConfig,\n    EngineConfig,\n    GenericSessionConfig,\n    GenericSQLAlchemyConfig,\n    SQLAlchemyAsyncConfig,\n    SQLAlchemyInitPlugin,\n    SQLAlchemySyncConfig,\n    SyncSessionConfig,\n)\nfrom .serialization import SQLAlchemySerializationPlugin\n\nif TYPE_CHECKING:\n    from litestar.config.app import AppConfig\n\n\nclass SQLAlchemyPlugin(InitPluginProtocol, _slots_base.SlotsBase):\n    \"\"\"A plugin that provides SQLAlchemy integration.\"\"\"\n\n    def __init__(self, config: SQLAlchemyAsyncConfig | SQLAlchemySyncConfig) -> None:\n        \"\"\"Initialize ``SQLAlchemyPlugin``.\n\n        Args:\n            config: configure DB connection and hook handlers and dependencies.\n        \"\"\"\n        self._config = config\n\n    def on_app_init(self, app_config: AppConfig) -> AppConfig:\n        \"\"\"Configure application for use with SQLAlchemy.\n\n        Args:\n            app_config: The :class:`AppConfig <.config.app.AppConfig>` instance.\n        \"\"\"\n        app_config.plugins.extend([SQLAlchemyInitPlugin(config=self._config), SQLAlchemySerializationPlugin()])\n        return app_config\n\n\n__all__ = (\n    \"AsyncSessionConfig\",\n    \"EngineConfig\",\n    \"GenericSQLAlchemyConfig\",\n    \"GenericSessionConfig\",\n    \"SQLAlchemyAsyncConfig\",\n    \"SQLAlchemyInitPlugin\",\n    \"SQLAlchemyPlugin\",\n    \"SQLAlchemySerializationPlugin\",\n    \"SQLAlchemySyncConfig\",\n    \"SyncSessionConfig\",\n)\n", "path": "litestar/contrib/sqlalchemy/plugins/__init__.py"}]}