-
Notifications
You must be signed in to change notification settings - Fork 261
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
Support for DDL expressions etc. #40
Comments
Are you thinking about a solution without SQLAlchemy / Alembic? |
Kinda. Eg. right now if test cases are using |
Something like... - async def execute(self, query: ClauseElement) -> typing.Any:
+ async def execute(
+ self, query: typing.Union[ClauseElement, DDLElement]
+ ) -> typing.Any:
assert self._connection is not None, "Connection is not acquired"
- query, args, result_columns = self._compile(query)
- return await self._connection.fetchval(query, *args)
+ if isinstance(query, DDLElement):
+ compiled = query.compile(dialect=self._dialect).string
+ await self._connection.execute(compiled)
+ return
+ else:
+ query, args, result_columns = self._compile(query)
+ return await self._connection.fetchval(query, *args) |
Currently migrations and table creation is always performed using sync drivers.
At some point we might want to consider how we can properly integrate the async drivers all the way through, in order to have low-dependency installs, and in order to make sure we're using the same drivers both for migration operations and for regular interactions.
There's no performance reasons for doing so, but it'd be nice if we had comprehensive support for the full set of possible database operations.
The text was updated successfully, but these errors were encountered: