Compare commits
No commits in common. "bbac0423190565c1a0391c0216b1c11faac5b769" and "b4ef56f2609aa23ca7896816d2d78a27e23dc535" have entirely different histories.
bbac042319
...
b4ef56f260
3 changed files with 6 additions and 17 deletions
10
CHANGELOG.md
10
CHANGELOG.md
|
|
@ -1,10 +1,5 @@
|
||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
## 0.4.1
|
|
||||||
|
|
||||||
- Fixed return types for `.sqlalchemy` module.
|
|
||||||
- `sqlalchemy.parent_children()` now takes a `lazy` parameter. Backported from 0.5.0.
|
|
||||||
|
|
||||||
## 0.4.0
|
## 0.4.0
|
||||||
|
|
||||||
+ `pydantic` is now a hard dependency
|
+ `pydantic` is now a hard dependency
|
||||||
|
|
@ -21,11 +16,6 @@
|
||||||
+ Added `addattr()`, `PrefixIdentifier()`, `mod_floor()`, `mod_ceil()`
|
+ Added `addattr()`, `PrefixIdentifier()`, `mod_floor()`, `mod_ceil()`
|
||||||
+ First version to have unit tests! (Coverage is not yet complete)
|
+ 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
|
## 0.3.7
|
||||||
|
|
||||||
- Fixed a bug in `b64decode()` padding handling which made the function inconsistent and non injective. Now, leading `'A'` is NEVER stripped.
|
- Fixed a bug in `b64decode()` padding handling which made the function inconsistent and non injective. Now, leading `'A'` is NEVER stripped.
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ from .snowflake import Snowflake, SnowflakeGen
|
||||||
from .lex import symbol_table, lex, ilex
|
from .lex import symbol_table, lex, ilex
|
||||||
from .strtools import PrefixIdentifier
|
from .strtools import PrefixIdentifier
|
||||||
|
|
||||||
__version__ = "0.4.1"
|
__version__ = "0.4.0"
|
||||||
|
|
||||||
__all__ = (
|
__all__ = (
|
||||||
'ConfigOptions', 'ConfigParserConfigSource', 'ConfigSource', 'ConfigValue',
|
'ConfigOptions', 'ConfigParserConfigSource', 'ConfigSource', 'ConfigValue',
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ from functools import wraps
|
||||||
from typing import Callable, Iterable, Never, TypeVar
|
from typing import Callable, Iterable, Never, TypeVar
|
||||||
import warnings
|
import warnings
|
||||||
from sqlalchemy import BigInteger, Boolean, CheckConstraint, Date, Dialect, ForeignKey, LargeBinary, Column, MetaData, SmallInteger, String, create_engine, select, text
|
from sqlalchemy import BigInteger, Boolean, 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 .snowflake import SnowflakeGen
|
||||||
from .itertools import kwargs_prefix, makelist
|
from .itertools import kwargs_prefix, makelist
|
||||||
|
|
@ -130,8 +130,7 @@ def bool_column(value: bool = False, nullable: bool = False, **kwargs):
|
||||||
return Column(Boolean, server_default=def_val, nullable=nullable, **kwargs)
|
return Column(Boolean, server_default=def_val, nullable=nullable, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
|
def declarative_base(domain_name: str, master_secret: bytes, metadata: dict | None = None, **kwargs) -> DeclarativeBase:
|
||||||
def declarative_base(domain_name: str, master_secret: bytes, metadata: dict | None = None, **kwargs) -> type[DeclarativeBase]:
|
|
||||||
"""
|
"""
|
||||||
Drop-in replacement for sqlalchemy.orm.declarative_base()
|
Drop-in replacement for sqlalchemy.orm.declarative_base()
|
||||||
taking in account requirements for SIQ generation (i.e. domain name).
|
taking in account requirements for SIQ generation (i.e. domain name).
|
||||||
|
|
@ -204,7 +203,7 @@ def age_pair(*, nullable: bool = False, **ka) -> tuple[Column, Column]:
|
||||||
return (date_col, acc_col)
|
return (date_col, acc_col)
|
||||||
|
|
||||||
|
|
||||||
def parent_children(keyword: str, /, *, lazy='selectin', **kwargs) -> tuple[Incomplete[Relationship], Incomplete[Relationship]]:
|
def parent_children(keyword: str, /, **kwargs):
|
||||||
"""
|
"""
|
||||||
Self-referential one-to-many relationship pair.
|
Self-referential one-to-many relationship pair.
|
||||||
Parent comes first, children come later.
|
Parent comes first, children come later.
|
||||||
|
|
@ -219,8 +218,8 @@ def parent_children(keyword: str, /, *, lazy='selectin', **kwargs) -> tuple[Inco
|
||||||
parent_kwargs = kwargs_prefix(kwargs, 'parent_')
|
parent_kwargs = kwargs_prefix(kwargs, 'parent_')
|
||||||
child_kwargs = kwargs_prefix(kwargs, 'child_')
|
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)
|
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}', lazy=lazy, **child_kwargs)
|
child = Incomplete(relationship, Wanted(lambda o, n: o.__name__), back_populates=f'parent_{keyword}', **child_kwargs)
|
||||||
|
|
||||||
return parent, child
|
return parent, child
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue