Skip to content

Commit

Permalink
some fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
zhPavel committed Feb 16, 2024
1 parent 8a2cc05 commit cee8efe
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion docs/reference/integrations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,12 @@ Known limitations:
- Only mapping to ``Table`` is supported,
implementations for ``FromClause`` instances such as ``Subquery`` and ``Join`` are not provided.

- Mapping to ``dataclass`` and ``attrs`` are not supported.

- It does not support registering order of mapped fields by design,
so you should use manual mapping to list instead automatic ``as_list=True``.

- Relationships with custom ``collection_class`` is not supported.
- Relationships with custom ``collection_class`` are not supported.

- All input fields of foreign keys and relationships are considered as optional
due to user can pass only relationship instance or only foreign key value.
4 changes: 2 additions & 2 deletions src/adaptix/_internal/model_tools/introspection/sqlalchemy.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,13 @@ def _get_autoincrement_column(table: 'sqlalchemy.Table'):

def _get_input_shape(
tp: TypeHint,
table: 'FromClause',
table: 'Table',
columns: 'ColumnCollection',
relationships: 'ReadOnlyProperties[RelationshipProperty[Any]]',
type_hints: Mapping[str, TypeHint],
) -> InputShape:
# FromClause has no autoincrement_column
autoincrement_column = _get_autoincrement_column(table) if isinstance(table, sqlalchemy.Table) else None
autoincrement_column = _get_autoincrement_column(table)
fields = []
params = []
for column in columns:
Expand Down

0 comments on commit cee8efe

Please sign in to comment.