Compare commits
No commits in common. "029b12867f51d9a9127e2cb591467180fa7d84b1" and "678d6ce2bbd879864317da41f2a52bfd250fa260" have entirely different histories.
029b12867f
...
678d6ce2bb
3 changed files with 6 additions and 12 deletions
|
|
@ -4,11 +4,6 @@
|
|||
|
||||
👀
|
||||
|
||||
## 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.
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ from .itertools import makelist, kwargs_prefix, ltuple, rtuple, additem
|
|||
from .i18n import I18n, JsonI18n, TomlI18n
|
||||
from .snowflake import Snowflake, SnowflakeGen
|
||||
|
||||
__version__ = "0.3.8"
|
||||
__version__ = "0.3.7"
|
||||
|
||||
__all__ = (
|
||||
'Siq', 'SiqCache', 'SiqType', 'SiqGen', 'StringCase',
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ from functools import wraps
|
|||
from typing import Callable, Iterable, Never, TypeVar
|
||||
import warnings
|
||||
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
|
||||
from sqlalchemy.orm import DeclarativeBase, Session, declarative_base as _declarative_base, relationship
|
||||
|
||||
from .snowflake import SnowflakeGen
|
||||
from .itertools import kwargs_prefix, makelist
|
||||
|
|
@ -120,8 +120,7 @@ def match_column(length: int, regex: str, /, case: StringCase = StringCase.AS_IS
|
|||
constraint_name=constraint_name or f'{x.__tablename__}_{n}_valid')), *args, **kwargs)
|
||||
|
||||
|
||||
|
||||
def declarative_base(domain_name: str, master_secret: bytes, metadata: dict | None = None, **kwargs) -> type[DeclarativeBase]:
|
||||
def declarative_base(domain_name: str, master_secret: bytes, metadata: dict | None = None, **kwargs):
|
||||
"""
|
||||
Drop-in replacement for sqlalchemy.orm.declarative_base()
|
||||
taking in account requirements for SIQ generation (i.e. domain name).
|
||||
|
|
@ -194,7 +193,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) -> tuple[Incomplete[Relationship], Incomplete[Relationship]]:
|
||||
def parent_children(keyword: str, /, **kwargs):
|
||||
"""
|
||||
Self-referential one-to-many relationship pair.
|
||||
Parent comes first, children come later.
|
||||
|
|
@ -209,8 +208,8 @@ def parent_children(keyword: str, /, *, lazy: str = 'selectin', **kwargs) -> tup
|
|||
parent_kwargs = kwargs_prefix(kwargs, 'parent_')
|
||||
child_kwargs = kwargs_prefix(kwargs, 'child_')
|
||||
|
||||
parent = Incomplete(relationship, Wanted(lambda o, n: o.__name__), back_populates=f'child_{keyword}s', lazy=lazy, **parent_kwargs)
|
||||
child = Incomplete(relationship, Wanted(lambda o, n: o.__name__), back_populates=f'parent_{keyword}', lazy=lazy, **child_kwargs)
|
||||
parent = Incomplete(relationship, Wanted(lambda o, n: o.__name__), back_populates=f'child_{keyword}s', **parent_kwargs)
|
||||
child = Incomplete(relationship, Wanted(lambda o, n: o.__name__), back_populates=f'parent_{keyword}', **child_kwargs)
|
||||
|
||||
return parent, child
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue