schemas added & lang models added

This commit is contained in:
2025-01-13 22:40:23 +03:00
parent 5d8b37179d
commit 50ae911d4e
56 changed files with 11037 additions and 8 deletions

View File

@@ -14,13 +14,13 @@ T = TypeVar("T")
class PostgresResponse(Generic[T]):
"""
Wrapper for PostgreSQL/SQLAlchemy query results.
Attributes:
query: SQLAlchemy query object
first: Whether to return first result only
data: Query results (lazy loaded)
count: Total count of results
Properties:
all: All results as list
first_item: First result only
@@ -63,7 +63,11 @@ class PostgresResponse(Generic[T]):
@property
def all(self) -> List[T]:
"""Get all results as list."""
return self.data if isinstance(self.data, list) else [self.data] if self.data else []
return (
self.data
if isinstance(self.data, list)
else [self.data] if self.data else []
)
@property
def first_item(self) -> Optional[T]: