Compare commits
No commits in common. "master" and "v0.12.0" have entirely different histories.
9 changed files with 23 additions and 62 deletions
|
|
@ -1,13 +1,5 @@
|
||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
## 0.12.2
|
|
||||||
|
|
||||||
+ Fix imports in module `sqlalchemy.quart`
|
|
||||||
|
|
||||||
## 0.12.1
|
|
||||||
|
|
||||||
+ Fix import failure for `AsyncSelectPagination` (module `sqlalchemy`)
|
|
||||||
|
|
||||||
## 0.12.0 "The Color Update"
|
## 0.12.0 "The Color Update"
|
||||||
|
|
||||||
* Moved `AsyncSelectPagination` to submodule `sqlalchemy.quart`. If you need to use it, specify `suou[quart_sqlalchemy]` in requirements.
|
* Moved `AsyncSelectPagination` to submodule `sqlalchemy.quart`. If you need to use it, specify `suou[quart_sqlalchemy]` in requirements.
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,6 @@ API
|
||||||
suou.lex
|
suou.lex
|
||||||
suou.luck
|
suou.luck
|
||||||
suou.markdown
|
suou.markdown
|
||||||
suou.mat
|
|
||||||
suou.migrate
|
suou.migrate
|
||||||
suou.peewee
|
suou.peewee
|
||||||
suou.quart
|
suou.quart
|
||||||
|
|
|
||||||
|
|
@ -20,27 +20,14 @@ Web colors
|
||||||
|
|
||||||
.. autoclass:: RGBColor
|
.. autoclass:: RGBColor
|
||||||
|
|
||||||
.. automethods::
|
|
||||||
|
|
||||||
|
|
||||||
.. autoclass:: WebColor
|
.. autoclass:: WebColor
|
||||||
|
|
||||||
|
|
||||||
.. autoclass:: LinearRGBColor
|
.. auto
|
||||||
|
|
||||||
.. automethods::
|
|
||||||
|
|
||||||
|
|
||||||
.. autoclass:: XYZColor
|
.. autoclass:: XYZColor
|
||||||
|
|
||||||
.. automethods::
|
|
||||||
|
|
||||||
|
|
||||||
.. autoclass:: OKLabColor
|
.. autoclass:: OKLabColor
|
||||||
|
|
||||||
.. automethods::
|
|
||||||
|
|
||||||
|
|
||||||
.. autoclass:: OKLCHColor
|
|
||||||
|
|
||||||
.. automethods::
|
|
||||||
|
|
@ -9,10 +9,7 @@
|
||||||
.. autosummary::
|
.. autosummary::
|
||||||
|
|
||||||
Chalk
|
Chalk
|
||||||
LinearRGBColor
|
|
||||||
OKLCHColor
|
|
||||||
OKLabColor
|
|
||||||
RGBColor
|
RGBColor
|
||||||
|
SRGBColor
|
||||||
WebColor
|
WebColor
|
||||||
XYZColor
|
|
||||||
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
suou.sqlalchemy.asyncio
|
suou.sqlalchemy.asyncio
|
||||||
=======================
|
=======================
|
||||||
|
|
||||||
.. automodule:: suou.sqlalchemy.asyncio
|
.. automodule:: suou.sqlalchemy.asyncio
|
||||||
|
|
@ -14,6 +14,7 @@
|
||||||
|
|
||||||
.. autosummary::
|
.. autosummary::
|
||||||
|
|
||||||
|
AsyncSelectPagination
|
||||||
SQLAlchemy
|
SQLAlchemy
|
||||||
SessionWrapper
|
SessionWrapper
|
||||||
|
|
||||||
|
|
@ -38,7 +38,7 @@ from .http import WantsContentType
|
||||||
from .color import OKLabColor, chalk, WebColor, RGBColor, LinearRGBColor, XYZColor, OKLCHColor
|
from .color import OKLabColor, chalk, WebColor, RGBColor, LinearRGBColor, XYZColor, OKLCHColor
|
||||||
from .mat import Matrix
|
from .mat import Matrix
|
||||||
|
|
||||||
__version__ = "0.12.2"
|
__version__ = "0.12.0"
|
||||||
|
|
||||||
__all__ = (
|
__all__ = (
|
||||||
'ConfigOptions', 'ConfigParserConfigSource', 'ConfigSource', 'ConfigValue',
|
'ConfigOptions', 'ConfigParserConfigSource', 'ConfigSource', 'ConfigValue',
|
||||||
|
|
|
||||||
|
|
@ -18,14 +18,18 @@ from __future__ import annotations
|
||||||
|
|
||||||
from abc import ABCMeta, abstractmethod
|
from abc import ABCMeta, abstractmethod
|
||||||
from functools import wraps
|
from functools import wraps
|
||||||
from typing import Callable, Iterable, Never, TypeVar
|
from typing import Any, Callable, Iterable, Never, TypeVar
|
||||||
from sqlalchemy import LargeBinary, Column, create_engine, select
|
import warnings
|
||||||
from sqlalchemy.orm import DeclarativeBase, Session
|
from sqlalchemy import BigInteger, Boolean, CheckConstraint, Date, Dialect, ForeignKey, LargeBinary, Column, MetaData, SmallInteger, String, create_engine, select, text
|
||||||
|
from sqlalchemy.orm import DeclarativeBase, InstrumentedAttribute, Relationship, Session, declarative_base as _declarative_base, relationship
|
||||||
from sqlalchemy.types import TypeEngine
|
from sqlalchemy.types import TypeEngine
|
||||||
|
|
||||||
from ..itertools import makelist
|
from ..snowflake import SnowflakeGen
|
||||||
|
from ..itertools import kwargs_prefix, makelist
|
||||||
from ..signing import HasSigner, UserSigner
|
from ..signing import HasSigner, UserSigner
|
||||||
from ..functools import deprecated
|
from ..codecs import StringCase
|
||||||
|
from ..functools import deprecated, not_implemented
|
||||||
|
from ..iding import Siq, SiqGen, SiqType, SiqCache
|
||||||
from ..classtools import Incomplete, Wanted
|
from ..classtools import Incomplete, Wanted
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -154,18 +158,12 @@ def require_auth_base(cls: type[DeclarativeBase], *, src: AuthSrc, column: str |
|
||||||
return decorator
|
return decorator
|
||||||
|
|
||||||
|
|
||||||
from .asyncio import SQLAlchemy, async_query
|
from .asyncio import SQLAlchemy, AsyncSelectPagination, async_query
|
||||||
from .orm import (
|
from .orm import (
|
||||||
id_column, snowflake_column, match_column, match_constraint, bool_column, declarative_base, parent_children,
|
id_column, snowflake_column, match_column, match_constraint, bool_column, declarative_base, parent_children,
|
||||||
author_pair, age_pair, bound_fk, unbound_fk, want_column, a_relationship, BitSelector, secret_column, username_column
|
author_pair, age_pair, bound_fk, unbound_fk, want_column, a_relationship, BitSelector, secret_column, username_column
|
||||||
)
|
)
|
||||||
|
|
||||||
try:
|
|
||||||
from .quart import AsyncSelectPagination
|
|
||||||
AsyncSelectPagination = deprecated('import AsyncSelectPagination from suou.sqlalchemy.quart instead')(AsyncSelectPagination)
|
|
||||||
except ImportError:
|
|
||||||
pass
|
|
||||||
|
|
||||||
# Optional dependency: do not import into __init__.py
|
# Optional dependency: do not import into __init__.py
|
||||||
__all__ = (
|
__all__ = (
|
||||||
'IdType', 'id_column', 'snowflake_column', 'entity_base', 'declarative_base', 'token_signer',
|
'IdType', 'id_column', 'snowflake_column', 'entity_base', 'declarative_base', 'token_signer',
|
||||||
|
|
|
||||||
|
|
@ -26,10 +26,6 @@ from sqlalchemy import Select, Table, func, select
|
||||||
from sqlalchemy.orm import DeclarativeBase, lazyload
|
from sqlalchemy.orm import DeclarativeBase, lazyload
|
||||||
from sqlalchemy.ext.asyncio import AsyncEngine, AsyncSession, create_async_engine
|
from sqlalchemy.ext.asyncio import AsyncEngine, AsyncSession, create_async_engine
|
||||||
|
|
||||||
try:
|
|
||||||
from .quart import AsyncSelectPagination
|
|
||||||
except ImportError:
|
|
||||||
AsyncSelectPagination = None
|
|
||||||
|
|
||||||
from suou.exceptions import NotFoundError
|
from suou.exceptions import NotFoundError
|
||||||
from suou.glue import glue
|
from suou.glue import glue
|
||||||
|
|
@ -107,16 +103,13 @@ class SQLAlchemy:
|
||||||
Return a pagination. Analogous to flask_sqlalchemy.SQLAlchemy.paginate().
|
Return a pagination. Analogous to flask_sqlalchemy.SQLAlchemy.paginate().
|
||||||
"""
|
"""
|
||||||
async with self as session:
|
async with self as session:
|
||||||
try:
|
return AsyncSelectPagination(
|
||||||
return AsyncSelectPagination(
|
select = select,
|
||||||
select = select,
|
session = session,
|
||||||
session = session,
|
page = page,
|
||||||
page = page,
|
per_page=per_page, max_per_page=max_per_page,
|
||||||
per_page=per_page, max_per_page=max_per_page,
|
error_out=self.NotFound if error_out else None, count=count
|
||||||
error_out=self.NotFound if error_out else None, count=count
|
)
|
||||||
)
|
|
||||||
except Exception:
|
|
||||||
raise RuntimeError('Cannot paginate; required dependencies are not installed')
|
|
||||||
async def create_all(self, *, checkfirst = True):
|
async def create_all(self, *, checkfirst = True):
|
||||||
"""
|
"""
|
||||||
Initialize database
|
Initialize database
|
||||||
|
|
|
||||||
|
|
@ -3,13 +3,7 @@ SQLAlchemy-Quart bindings
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
from select import select
|
|
||||||
from flask_sqlalchemy.pagination import Pagination
|
from flask_sqlalchemy.pagination import Pagination
|
||||||
from sqlalchemy import Select, func
|
|
||||||
from sqlalchemy.ext.asyncio import AsyncSession
|
|
||||||
from sqlalchemy.orm import lazyload
|
|
||||||
|
|
||||||
from ..exceptions import NotFoundError
|
|
||||||
|
|
||||||
|
|
||||||
class AsyncSelectPagination(Pagination):
|
class AsyncSelectPagination(Pagination):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue