Excuse me, missed your response.
Found this soultiuon:
>>> print(compile_query(Foo.__table__.insert().values(bar='zoo').compile(
Session.bind.dialect))
INSERT INTO foos (bar) VALUES ('zoo')
пятница, 13 октября 2017 г., 19:41:29 UTC+3 пользователь Mike Bayer написал:
>
> On Fri, Oct 13, 2017
On Fri, Oct 13, 2017 at 11:21 AM, Антонио Антуан wrote:
> I've seen it and thought that some ways available...
you can maybe "capture" it via a logger but that's only as it runs.
The INSERT statement has to also return data to the ORM so it's not
tailored for "offline" use.
I've seen it and thought that some ways available...
пт, 13 окт. 2017 г. в 17:30, Mike Bayer :
> On Fri, Oct 13, 2017 at 8:43 AM, Антонио Антуан
> wrote:
> > I use such code to generate raw SQL from SQLA-queries:
> >
> > def
On Fri, Oct 13, 2017 at 8:43 AM, Антонио Антуан wrote:
> I use such code to generate raw SQL from SQLA-queries:
>
> def compile_statement(statement):
> comp = statement.compile(dialect=postgresql.dialect())
> params = {}
> for k, v in comp.params.items():
>
I use such code to generate raw SQL from SQLA-queries:
def compile_statement(statement):
comp = statement.compile(dialect=postgresql.dialect())
params = {}
for k, v in comp.params.items():
if isinstance(v, unicode):
v = v.encode(cls.encoding)
params[k] =