From 958779bc8a0ade908df95f283c33b07995b890fd Mon Sep 17 00:00:00 2001 From: Yusur Princeps Date: Sat, 23 Aug 2025 14:54:58 +0200 Subject: [PATCH] update changelog, add lazy= to parent_children() --- CHANGELOG.md | 5 +++++ src/suou/sqlalchemy.py | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index db198c0..253f01d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,6 +33,11 @@ + Added `addattr()`, `PrefixIdentifier()`, `mod_floor()`, `mod_ceil()` + First version to have unit tests! (Coverage is not yet complete) +## 0.3.8 + +- Fixed return types for `.sqlalchemy` module. +- `sqlalchemy.parent_children()` now takes a `lazy` parameter. Backported from 0.5.0. + ## 0.3.7 - Fixed a bug in `b64decode()` padding handling which made the function inconsistent and non injective. Now, leading `'A'` is NEVER stripped. diff --git a/src/suou/sqlalchemy.py b/src/suou/sqlalchemy.py index 9f84610..6be1d8a 100644 --- a/src/suou/sqlalchemy.py +++ b/src/suou/sqlalchemy.py @@ -20,9 +20,14 @@ from abc import ABCMeta, abstractmethod from functools import wraps from typing import Callable, Iterable, Never, TypeVar import warnings +<<<<<<< HEAD from sqlalchemy import BigInteger, Boolean, CheckConstraint, Date, Dialect, ForeignKey, LargeBinary, Column, MetaData, SmallInteger, String, create_engine, select, text from sqlalchemy.orm import DeclarativeBase, InstrumentedAttribute, Session, declarative_base as _declarative_base, relationship from sqlalchemy.types import TypeEngine +======= +from sqlalchemy import BigInteger, CheckConstraint, Date, Dialect, ForeignKey, LargeBinary, Column, MetaData, SmallInteger, String, create_engine, select, text +from sqlalchemy.orm import DeclarativeBase, Relationship, Session, declarative_base as _declarative_base, relationship +>>>>>>> a66f591 (update changelog, add lazy= to parent_children()) from .snowflake import SnowflakeGen from .itertools import kwargs_prefix, makelist @@ -204,7 +209,7 @@ def age_pair(*, nullable: bool = False, **ka) -> tuple[Column, Column]: return (date_col, acc_col) -def parent_children(keyword: str, /, *, lazy: str = 'selectin', **kwargs): +def parent_children(keyword: str, /, *, lazy='selectin', **kwargs) -> tuple[Incomplete[Relationship], Incomplete[Relationship]]: """ Self-referential one-to-many relationship pair. Parent comes first, children come later.