Compare commits
4 commits
1a9fa55dd8
...
94faac8863
| Author | SHA1 | Date | |
|---|---|---|---|
| 94faac8863 | |||
| 958779bc8a | |||
| 0345ee58fc | |||
| f1f8131299 |
3 changed files with 22 additions and 3 deletions
14
CHANGELOG.md
14
CHANGELOG.md
|
|
@ -1,5 +1,9 @@
|
||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 0.5.1
|
||||||
|
|
||||||
|
- Fixed return types for `.sqlalchemy` module
|
||||||
|
|
||||||
## 0.5.0
|
## 0.5.0
|
||||||
|
|
||||||
+ `sqlalchemy`: add `unbound_fk()`, `bound_fk()`
|
+ `sqlalchemy`: add `unbound_fk()`, `bound_fk()`
|
||||||
|
|
@ -17,6 +21,11 @@
|
||||||
+ Add `quart` module with `negotiate()`, `add_rest()`, `add_i18n()`, `WantsContentType`
|
+ Add `quart` module with `negotiate()`, `add_rest()`, `add_i18n()`, `WantsContentType`
|
||||||
+ Add `dei` module: it implements a compact and standardized representation for pronouns, inspired by the one in use at PronounDB
|
+ Add `dei` module: it implements a compact and standardized representation for pronouns, inspired by the one in use at PronounDB
|
||||||
|
|
||||||
|
## 0.4.1
|
||||||
|
|
||||||
|
- Fixed return types for `.sqlalchemy` module.
|
||||||
|
- `sqlalchemy.parent_children()` now takes a `lazy` parameter. Backported from 0.5.1.
|
||||||
|
|
||||||
## 0.4.0
|
## 0.4.0
|
||||||
|
|
||||||
+ `pydantic` is now a hard dependency
|
+ `pydantic` is now a hard dependency
|
||||||
|
|
@ -33,6 +42,11 @@
|
||||||
+ 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.1.
|
||||||
|
|
||||||
## 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.
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ from .validators import matches
|
||||||
from .redact import redact_url_password
|
from .redact import redact_url_password
|
||||||
from .http import WantsContentType
|
from .http import WantsContentType
|
||||||
|
|
||||||
__version__ = "0.5.0"
|
__version__ = "0.5.1"
|
||||||
|
|
||||||
__all__ = (
|
__all__ = (
|
||||||
'ConfigOptions', 'ConfigParserConfigSource', 'ConfigSource', 'ConfigValue',
|
'ConfigOptions', 'ConfigParserConfigSource', 'ConfigSource', 'ConfigValue',
|
||||||
|
|
|
||||||
|
|
@ -20,9 +20,14 @@ from abc import ABCMeta, abstractmethod
|
||||||
from functools import wraps
|
from functools import wraps
|
||||||
from typing import Callable, Iterable, Never, TypeVar
|
from typing import Callable, Iterable, Never, TypeVar
|
||||||
import warnings
|
import warnings
|
||||||
|
<<<<<<< HEAD
|
||||||
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, InstrumentedAttribute, Session, declarative_base as _declarative_base, relationship
|
from sqlalchemy.orm import DeclarativeBase, InstrumentedAttribute, Session, declarative_base as _declarative_base, relationship
|
||||||
from sqlalchemy.types import TypeEngine
|
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 .snowflake import SnowflakeGen
|
||||||
from .itertools import kwargs_prefix, makelist
|
from .itertools import kwargs_prefix, makelist
|
||||||
|
|
@ -131,7 +136,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 +209,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: str = 'selectin', **kwargs):
|
def parent_children(keyword: str, /, *, lazy='selectin', **kwargs) -> tuple[Incomplete[Relationship], Incomplete[Relationship]]:
|
||||||
"""
|
"""
|
||||||
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.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue