On Wed, May 11, 2016 at 10:37 AM, Piotr Dobrogost
<[email protected]> wrote:
>> On Wednesday, May 11, 2016 at 11:03:57 AM UTC+2, Simon King wrote:
>>> On Wed, May 11, 2016 at 9:39 AM, Piotr Dobrogost
>>>
>>> What's the reason for these differences?
>>
>> At least for the quoting issue, it sounds like you aren't using the
>> Oracle dialect. What does "print mock_engine.dialect" report?
>
> <sqlalchemy.dialects.oracle.cx_oracle.OracleDialect_cx_oracle object at
> 0x7f99d2b0db10>
>
Ah, ok. The problem is that the "sql" parameter in your executor
function has not yet been compiled for the dialect in use. Try this
instead:
from __future__ import print_function
import sqlalchemy as sa
engine = sa.create_engine(
'oracle://',
strategy='mock',
executor=lambda sql, *multiparams, **params: print(sql.compile(bind=engine))
)
metadata = sa.MetaData()
t = sa.Table(
'_acl',
metadata,
sa.Column('_id', sa.Integer, primary_key=True),
)
metadata.create_all(engine)
engine.execute(t.select())
Simon
--
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.