prompt: 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/types.py`
  Content:
  ```
  1 from __future__ import annotations
  2 
  3 import uuid
  4 from typing import TYPE_CHECKING, Any, cast
  5 
  6 from sqlalchemy.dialects.postgresql import JSONB as PG_JSONB
  7 from sqlalchemy.dialects.postgresql import UUID as PG_UUID
  8 from sqlalchemy.types import BINARY, CHAR, BigInteger, Integer, TypeDecorator
  9 from sqlalchemy.types import JSON as _JSON
  10 
  11 if TYPE_CHECKING:
  12     from sqlalchemy.engine import Dialect
  13 
  14 BigIntIdentity = BigInteger().with_variant(Integer, "sqlite")
  15 """Platform-independent BigInteger Primary Key.
  16 
  17 User a Big Integer on engines that support it.
  18 
  19 Uses Integer for sqlite since there is no
  20 
  21 """
  22 
  23 
  24 class GUID(TypeDecorator):
  25     """Platform-independent GUID type.
  26 
  27     Uses PostgreSQL's UUID type, otherwise uses
  28     BINARY(16) or CHAR(32), storing as stringified hex values.
  29 
  30     Will accept stringified UUIDs as a hexstring or an actual UUID
  31 
  32     """
  33 
  34     impl = BINARY(16)
  35     cache_ok = True
  36     python_type = type(uuid.UUID)
  37 
  38     def __init__(self, binary: bool = True) -> None:
  39         self.binary = binary
  40 
  41     def load_dialect_impl(self, dialect: Dialect) -> Any:
  42         if dialect.name == "postgresql":
  43             return dialect.type_descriptor(PG_UUID())
  44         if self.binary:
  45             return dialect.type_descriptor(BINARY(16))
  46         return dialect.type_descriptor(CHAR(32))
  47 
  48     def process_bind_param(self, value: bytes | str | uuid.UUID | None, dialect: Dialect) -> bytes | str | None:
  49         if value is None:
  50             return value
  51         if dialect.name == "postgresql":
  52             return str(value)
  53         value = self.to_uuid(value)
  54         if value is None:
  55             return value
  56         return value.bytes if self.binary else value.hex
  57 
  58     def process_result_value(self, value: bytes | str | uuid.UUID | None, dialect: Dialect) -> uuid.UUID | None:
  59         if value is None:
  60             return value
  61         if isinstance(value, uuid.UUID):
  62             return value
  63         if self.binary:
  64             return uuid.UUID(bytes=cast("bytes", value))
  65         return uuid.UUID(hex=cast("str", value))
  66 
  67     @staticmethod
  68     def to_uuid(value: Any) -> uuid.UUID | None:
  69         if isinstance(value, uuid.UUID) or value is None:
  70             return value
  71         try:
  72             value = uuid.UUID(hex=value)
  73         except (TypeError, ValueError):
  74             value = uuid.UUID(bytes=value)
  75         return cast("uuid.UUID | None", value)
  76 
  77 
  78 class JSON(_JSON):
  79     """Platform-independent JSON type.
  80 
  81     Uses JSONB type for postgres, otherwise uses the generic JSON data type.
  82     """
  83 
  84     def load_dialect_impl(self, dialect: Dialect) -> Any:
  85         if dialect.name == "postgresql":
  86             return dialect.type_descriptor(PG_JSONB())  # type: ignore[no-untyped-call]
  87         return dialect.type_descriptor(_JSON())
  88
  ```
  --- 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()
  
  ```
  
golden_diff: diff --git a/litestar/contrib/sqlalchemy/types.py b/litestar/contrib/sqlalchemy/types.py
  --- a/litestar/contrib/sqlalchemy/types.py
  +++ b/litestar/contrib/sqlalchemy/types.py
  @@ -35,7 +35,7 @@
       cache_ok = True
       python_type = type(uuid.UUID)
   
  -    def __init__(self, binary: bool = True) -> None:
  +    def __init__(self, *args: Any, binary: bool = True, **kwargs: Any) -> None:
           self.binary = binary
   
       def load_dialect_impl(self, dialect: Dialect) -> Any:
  @@ -75,13 +75,8 @@
           return cast("uuid.UUID | None", value)
   
   
  -class JSON(_JSON):
  -    """Platform-independent JSON type.
  +JSON = _JSON().with_variant(PG_JSONB, "postgresql")
  +"""Platform-independent JSON type.
   
       Uses JSONB type for postgres, otherwise uses the generic JSON data type.
  -    """
  -
  -    def load_dialect_impl(self, dialect: Dialect) -> Any:
  -        if dialect.name == "postgresql":
  -            return dialect.type_descriptor(PG_JSONB())  # type: ignore[no-untyped-call]
  -        return dialect.type_descriptor(_JSON())
  +"""
  
verification_info: {"golden_diff": "diff --git a/litestar/contrib/sqlalchemy/types.py b/litestar/contrib/sqlalchemy/types.py\n--- a/litestar/contrib/sqlalchemy/types.py\n+++ b/litestar/contrib/sqlalchemy/types.py\n@@ -35,7 +35,7 @@\n     cache_ok = True\n     python_type = type(uuid.UUID)\n \n-    def __init__(self, binary: bool = True) -> None:\n+    def __init__(self, *args: Any, binary: bool = True, **kwargs: Any) -> None:\n         self.binary = binary\n \n     def load_dialect_impl(self, dialect: Dialect) -> Any:\n@@ -75,13 +75,8 @@\n         return cast(\"uuid.UUID | None\", value)\n \n \n-class JSON(_JSON):\n-    \"\"\"Platform-independent JSON type.\n+JSON = _JSON().with_variant(PG_JSONB, \"postgresql\")\n+\"\"\"Platform-independent JSON type.\n \n     Uses JSONB type for postgres, otherwise uses the generic JSON data type.\n-    \"\"\"\n-\n-    def load_dialect_impl(self, dialect: Dialect) -> Any:\n-        if dialect.name == \"postgresql\":\n-            return dialect.type_descriptor(PG_JSONB())  # type: ignore[no-untyped-call]\n-        return dialect.type_descriptor(_JSON())\n+\"\"\"\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\nimport uuid\nfrom typing import TYPE_CHECKING, Any, cast\n\nfrom sqlalchemy.dialects.postgresql import JSONB as PG_JSONB\nfrom sqlalchemy.dialects.postgresql import UUID as PG_UUID\nfrom sqlalchemy.types import BINARY, CHAR, BigInteger, Integer, TypeDecorator\nfrom sqlalchemy.types import JSON as _JSON\n\nif TYPE_CHECKING:\n    from sqlalchemy.engine import Dialect\n\nBigIntIdentity = BigInteger().with_variant(Integer, \"sqlite\")\n\"\"\"Platform-independent BigInteger Primary Key.\n\nUser a Big Integer on engines that support it.\n\nUses Integer for sqlite since there is no\n\n\"\"\"\n\n\nclass GUID(TypeDecorator):\n    \"\"\"Platform-independent GUID type.\n\n    Uses PostgreSQL's UUID type, otherwise uses\n    BINARY(16) or CHAR(32), storing as stringified hex values.\n\n    Will accept stringified UUIDs as a hexstring or an actual UUID\n\n    \"\"\"\n\n    impl = BINARY(16)\n    cache_ok = True\n    python_type = type(uuid.UUID)\n\n    def __init__(self, binary: bool = True) -> None:\n        self.binary = binary\n\n    def load_dialect_impl(self, dialect: Dialect) -> Any:\n        if dialect.name == \"postgresql\":\n            return dialect.type_descriptor(PG_UUID())\n        if self.binary:\n            return dialect.type_descriptor(BINARY(16))\n        return dialect.type_descriptor(CHAR(32))\n\n    def process_bind_param(self, value: bytes | str | uuid.UUID | None, dialect: Dialect) -> bytes | str | None:\n        if value is None:\n            return value\n        if dialect.name == \"postgresql\":\n            return str(value)\n        value = self.to_uuid(value)\n        if value is None:\n            return value\n        return value.bytes if self.binary else value.hex\n\n    def process_result_value(self, value: bytes | str | uuid.UUID | None, dialect: Dialect) -> uuid.UUID | None:\n        if value is None:\n            return value\n        if isinstance(value, uuid.UUID):\n            return value\n        if self.binary:\n            return uuid.UUID(bytes=cast(\"bytes\", value))\n        return uuid.UUID(hex=cast(\"str\", value))\n\n    @staticmethod\n    def to_uuid(value: Any) -> uuid.UUID | None:\n        if isinstance(value, uuid.UUID) or value is None:\n            return value\n        try:\n            value = uuid.UUID(hex=value)\n        except (TypeError, ValueError):\n            value = uuid.UUID(bytes=value)\n        return cast(\"uuid.UUID | None\", value)\n\n\nclass JSON(_JSON):\n    \"\"\"Platform-independent JSON type.\n\n    Uses JSONB type for postgres, otherwise uses the generic JSON data type.\n    \"\"\"\n\n    def load_dialect_impl(self, dialect: Dialect) -> Any:\n        if dialect.name == \"postgresql\":\n            return dialect.type_descriptor(PG_JSONB())  # type: ignore[no-untyped-call]\n        return dialect.type_descriptor(_JSON())\n", "path": "litestar/contrib/sqlalchemy/types.py"}], "after_files": [{"content": "from __future__ import annotations\n\nimport uuid\nfrom typing import TYPE_CHECKING, Any, cast\n\nfrom sqlalchemy.dialects.postgresql import JSONB as PG_JSONB\nfrom sqlalchemy.dialects.postgresql import UUID as PG_UUID\nfrom sqlalchemy.types import BINARY, CHAR, BigInteger, Integer, TypeDecorator\nfrom sqlalchemy.types import JSON as _JSON\n\nif TYPE_CHECKING:\n    from sqlalchemy.engine import Dialect\n\nBigIntIdentity = BigInteger().with_variant(Integer, \"sqlite\")\n\"\"\"Platform-independent BigInteger Primary Key.\n\nUser a Big Integer on engines that support it.\n\nUses Integer for sqlite since there is no\n\n\"\"\"\n\n\nclass GUID(TypeDecorator):\n    \"\"\"Platform-independent GUID type.\n\n    Uses PostgreSQL's UUID type, otherwise uses\n    BINARY(16) or CHAR(32), storing as stringified hex values.\n\n    Will accept stringified UUIDs as a hexstring or an actual UUID\n\n    \"\"\"\n\n    impl = BINARY(16)\n    cache_ok = True\n    python_type = type(uuid.UUID)\n\n    def __init__(self, *args: Any, binary: bool = True, **kwargs: Any) -> None:\n        self.binary = binary\n\n    def load_dialect_impl(self, dialect: Dialect) -> Any:\n        if dialect.name == \"postgresql\":\n            return dialect.type_descriptor(PG_UUID())\n        if self.binary:\n            return dialect.type_descriptor(BINARY(16))\n        return dialect.type_descriptor(CHAR(32))\n\n    def process_bind_param(self, value: bytes | str | uuid.UUID | None, dialect: Dialect) -> bytes | str | None:\n        if value is None:\n            return value\n        if dialect.name == \"postgresql\":\n            return str(value)\n        value = self.to_uuid(value)\n        if value is None:\n            return value\n        return value.bytes if self.binary else value.hex\n\n    def process_result_value(self, value: bytes | str | uuid.UUID | None, dialect: Dialect) -> uuid.UUID | None:\n        if value is None:\n            return value\n        if isinstance(value, uuid.UUID):\n            return value\n        if self.binary:\n            return uuid.UUID(bytes=cast(\"bytes\", value))\n        return uuid.UUID(hex=cast(\"str\", value))\n\n    @staticmethod\n    def to_uuid(value: Any) -> uuid.UUID | None:\n        if isinstance(value, uuid.UUID) or value is None:\n            return value\n        try:\n            value = uuid.UUID(hex=value)\n        except (TypeError, ValueError):\n            value = uuid.UUID(bytes=value)\n        return cast(\"uuid.UUID | None\", value)\n\n\nJSON = _JSON().with_variant(PG_JSONB, \"postgresql\")\n\"\"\"Platform-independent JSON type.\n\n    Uses JSONB type for postgres, otherwise uses the generic JSON data type.\n\"\"\"\n", "path": "litestar/contrib/sqlalchemy/types.py"}]}