You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
The only way to create tables described is with db.gino.create_all(...) or it's alias db.gino.create(...). But in case one needs to execute an auto-generated DDL while being in a transaction there's no simple way to do that.
That took me a load of time of debugging to gain a working way:
Here we call a "protected" method of GinoConnection class which violates coding guides since underscore methods are not intended to be called by class guests.
Describe the solution you'd like
For example, the AsyncSchemaGenerator (or it's subclass which is my case) could be bound to every GinoConnection yielded from a pool and then there be just a simple GinoConnection.create(self, tables, **kwargs) method that allows a user to execute DDL generated. The AsyncSchemaGenerator could of course be passed through from the very db down to GinoConnection constructor through whatever middlewares exist: Pools and so on.
The text was updated successfully, but these errors were encountered:
Right, the "protected" shouldn't be used, as they will be gone in GINO 1.4 which will adopt SQLAlchemy 1.4 with its asynchronous support, we won't need the AsyncSchemaGenerator hack any more at that time. Please check the v2.0.x branch (and upcoming v1.4.x branch) for updates.
Is your feature request related to a problem? Please describe.
The only way to create tables described is with
db.gino.create_all(...)
or it's aliasdb.gino.create(...)
. But in case one needs to execute an auto-generated DDL while being in a transaction there's no simple way to do that.That took me a load of time of debugging to gain a working way:
Here we call a "protected" method of
GinoConnection
class which violates coding guides since underscore methods are not intended to be called by class guests.Describe the solution you'd like
For example, the
AsyncSchemaGenerator
(or it's subclass which is my case) could be bound to everyGinoConnection
yielded from a pool and then there be just a simpleGinoConnection.create(self, tables, **kwargs)
method that allows a user to execute DDL generated. TheAsyncSchemaGenerator
could of course be passed through from the verydb
down toGinoConnection
constructor through whatever middlewares exist:Pool
s and so on.The text was updated successfully, but these errors were encountered: