On 04/02/2010 18:19, Michael Bayer wrote:
werner wrote:
...
that sounds very strange.  0.4 and earlier would use TEXT for String with
no size.  In 0.5 we did away with that, as its a surprise - we had lot of
"string with no length" complaints, but I would prefer people learn about
String/String(50) instead of assuming that String always needs a length,
since that adds to the "verbose" narrative which really isn't true.  You
need the length only if you are issuing CREATE TABLE and you are on a
database that cares about the length.  Otherwise you do not need it (PG
and SQLite both allow VARCHAR with no length).   "String" is used in other
places besides table metadata, including func.foo(..., type_=String),
cast(x, String), etc.

I'm not aware off the top of my head which dialect could have been
emitting BLOB for VARCHAR, since those two types aren't even compatible.
Just FYI:

echo with 0.5.8 and FB 2.1 with kinterbasdb:

SQLAlchemy version: 0.5.8
2010-02-04 18:22:14,473 INFO sqlalchemy.engine.base.Engine.0x...48f0
        SELECT 1 FROM rdb$database
        WHERE EXISTS (SELECT rdb$relation_name
                      FROM rdb$relations
                      WHERE rdb$relation_name=?)
....

2010-02-04 18:22:14,536 INFO sqlalchemy.engine.base.Engine.0x...48f0
CREATE TABLE users (
    id INTEGER NOT NULL,
    name BLOB SUB_TYPE 1,
    fullname BLOB SUB_TYPE 1,
    "password" BLOB SUB_TYPE 1,
    PRIMARY KEY (id)
)

2010-02-04 18:22:14,536 INFO sqlalchemy.engine.base.Engine.0x...48f0 ()
2010-02-04 18:22:14,536 INFO sqlalchemy.engine.base.Engine.0x...48f0 COMMIT

echo with 0.6b1

SQLAlchemy version: 0.6beta1
2010-02-04 18:25:32,516 INFO sqlalchemy.engine.base.Engine.0x...eb30
        SELECT 1 FROM rdb$database
        WHERE EXISTS (SELECT rdb$relation_name

,,,,

2010-02-04 18:25:32,578 INFO sqlalchemy.engine.base.Engine.0x...eb30
CREATE TABLE users (
    id INTEGER NOT NULL,
    name VARCHAR,
    fullname VARCHAR,
    "password" VARCHAR,
    PRIMARY KEY (id)
)


2010-02-04 18:25:32,578 INFO sqlalchemy.engine.base.Engine.0x...eb30 ()

Werner

--
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalch...@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to