- changed status to invalid
add MSGenericText
MSGenericText
would be similar to MSGenericBinary
in the mssql module. It would allow specification of the Text()
type which would at the DDL level issue one of TINYTEXT
, TEXT
, MEDIUMTEXT
, etc. based on the size given.
The use case here is that a user wants to use the Text()
type to specify a column of unlimited length, but the current default of MSText
apparently does not allow sizes over 65535.
I need confirmation that Text()
in fact has a limit of 65535 (which seems bizarre) and that this is the only feasable strategy to work with this use case.
Comments (6)
-
-
Also, Text() with no length could emit LONGTEXT by default, sure. The storage requirements for NULL values are a bit bigger than the standard TEXT. I think that's that would be the only downside.
-
reporter - removed status
- changed status to open
hokay, so please tell me, or just reply on the list, what issue the user is having here, and then we close the ticket:
http://groups.google.com/group/sqlalchemy/browse_frm/thread/7b33762ead522440#
-
Missed that thread in my mail outage... but it works ok here for 232-1, the max size TEXT() will accept. (232 will raise an error from the server.)
>>> from sqlalchemy import * >>> m = MetaData('mysql:///test') >>> t = Table('t', m, ... Column('data', Text(4294967295), nullable=False)) >>> t.create() >>> c = m.bind.connect() >>> print c.execute('SHOW CREATE TABLE t').fetchall() ['CREATE TABLE `t` (\n `data` longtext NOT NULL\n) ENGINE=MyISAM DEFAULT CHARSET=latin1')](('t',) >>> t.drop()
-
reporter - changed status to invalid
confirmed by the original reporter the smaller number works for him too.
-
reporter - removed milestone
Removing milestone: 0.5.xx (automated comment)
- Log in to comment
The MSText and mysql's TEXT already do this. See the length property of the docstring.
http://www.sqlalchemy.org/docs/05/reference/dialects/mysql.html#sqlalchemy.databases.mysql.MSText