On Monday, May 9, 2016 at 5:05:11 PM UTC+2, Mike Bayer wrote:
>
>
> the only thing that is sigificant with "mock" is the first part of the 
> URL.   You can just send the whole URL though, so just like this: 
>

> mock_engine = create_engine(real_engine.url, strategy="mock", ...) 
>

I see differences between SQL emitted by mock engine and the one emitted by 
real engine.
Some columns in my db use JsonType which is based on Text type:

class JsonType(TypeDecorator):
    impl = Text
    (...)

class Tab(Base):
    annotations = Column(NestedMutationDict.as_mutable(JsonType))
    (...)

For these columns the type used by mock engine is TEXT whereas the type 
used by real engine is CLOB.

>From mock:

CREATE TABLE nodes (
id INTEGER NOT NULL, 
type VARCHAR(30) NOT NULL, 
parent_id INTEGER, 
position INTEGER, 
_acl TEXT, 
name VARCHAR(250), 
title VARCHAR(250), 
annotations TEXT, 
path VARCHAR(2000), 
PRIMARY KEY (id), 
UNIQUE (parent_id, name), 
FOREIGN KEY(parent_id) REFERENCES nodes (id)
)

>From real engine:
CREATE TABLE nodes (
id INTEGER NOT NULL, 
type VARCHAR2(30 CHAR) NOT NULL, 
parent_id INTEGER, 
position INTEGER, 
"_acl" CLOB, 
name NVARCHAR2(250), 
title NVARCHAR2(250), 
annotations CLOB, 
path NVARCHAR2(2000), 
PRIMARY KEY (id), 
UNIQUE (parent_id, name), 
FOREIGN KEY(parent_id) REFERENCES nodes (id)
)

The second difference is that real engine quotes the name of column which 
begins with underscore (_acl) but the mock one does not. Oracle treats 
unquoted version as invalid giving the following error:
ORA-00911: invalid character


What's the reason for these differences?


Regards,
Piotr

-- 
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 sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to