mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-10 03:28:53 +00:00
perf(proxy): reduce Prisma client import time
This commit is contained in:
parent
f005afa146
commit
b98c7c828e
4 changed files with 23 additions and 0 deletions
|
|
@ -5,6 +5,7 @@ datasource client {
|
|||
|
||||
generator client {
|
||||
provider = "prisma-client-py"
|
||||
recursive_type_depth = -1
|
||||
binaryTargets = ["native", "debian-openssl-1.1.x", "debian-openssl-3.0.x", "linux-musl", "linux-musl-openssl-3.0.x"]
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ datasource client {
|
|||
|
||||
generator client {
|
||||
provider = "prisma-client-py"
|
||||
recursive_type_depth = -1
|
||||
binaryTargets = ["native", "debian-openssl-1.1.x", "debian-openssl-3.0.x", "linux-musl", "linux-musl-openssl-3.0.x"]
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ datasource client {
|
|||
|
||||
generator client {
|
||||
provider = "prisma-client-py"
|
||||
recursive_type_depth = -1
|
||||
binaryTargets = ["native", "debian-openssl-1.1.x", "debian-openssl-3.0.x", "linux-musl", "linux-musl-openssl-3.0.x"]
|
||||
}
|
||||
|
||||
|
|
|
|||
20
tests/test_litellm/proxy/test_prisma_schema.py
Normal file
20
tests/test_litellm/proxy/test_prisma_schema.py
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
from pathlib import Path
|
||||
from typing import Final
|
||||
|
||||
import pytest
|
||||
|
||||
|
||||
REPOSITORY_ROOT: Final = Path(__file__).resolve().parents[3]
|
||||
SCHEMA_PATHS: Final = (
|
||||
REPOSITORY_ROOT / "schema.prisma",
|
||||
REPOSITORY_ROOT / "litellm/proxy/schema.prisma",
|
||||
REPOSITORY_ROOT / "litellm-proxy-extras/litellm_proxy_extras/schema.prisma",
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("schema_path", SCHEMA_PATHS)
|
||||
def test_prisma_client_uses_recursive_types(schema_path: Path) -> None:
|
||||
schema: Final = schema_path.read_text(encoding="utf-8")
|
||||
generator_settings: Final = schema.partition("generator client {")[2].partition("}")[0]
|
||||
|
||||
assert "recursive_type_depth = -1" in tuple(line.strip() for line in generator_settings.splitlines())
|
||||
Loading…
Add table
Reference in a new issue