Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempt to be compatible with synchronous event callbacks #703

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

wwwjfy
Copy link
Member

@wwwjfy wwwjfy commented Jun 20, 2020

based on #702, refs #691, a hacky fix

Honestly, Gino doesn't have to support table creation/deletion, as this can go farther, like requests of async version of Alembic, though it can be done in another package.

@wwwjfy wwwjfy marked this pull request as draft June 21, 2020 15:21
@fantix
Copy link
Member

fantix commented Sep 6, 2020

Right - the schema.py will be completely removed in GINO 1.4, replaced by a very simple bridge:

gino/src/gino/api.py

Lines 213 to 227 in 8c888bd

class GinoSchemaVisitor:
__slots__ = ("_item",)
def __init__(self, item):
self._item = item
def __getattr__(self, item):
sync_func = getattr(self._item, item)
async def _wrapper(bind=None, *args, **kwargs):
if bind is None:
bind = _bind_or_error(self._item)
return await bind.run_sync(sync_func, *args, **kwargs)
return _wrapper

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants