make it clear that Text() is generally an "unlengthed" type
On SQLServer, creating a table with a column of type sqlalchemy.Text(50)
gives the error Cannot specify a column width on data type text
.
General advice is to use the VARCHAR
type. But I'm trying to create a generic application, so the Text
type should work ...
Would it be possible for SQL Server to convert Text
to VARCHAR
if it has a length? Or is there a better way of handling this?
Comments (5)
-
Account Deleted -
repo owner - changed component to documentation
- changed title to make it clear that Text() is generally an "unlengthed" type
- marked as minor
- changed milestone to 0.6.xx
- assigned issue to
if you have a length, you should generally use String(), not Text(). We have done some automatic "switching" of these types in the past based on length present or not (the reverse of this case, actually) but that's no longer the current practice.
The documentation for
Text
doesn't seem to make this clear enough, that it's generally the "unlengthed" type, if the user were not familiar with the CLOB and TEXT types. -
Account Deleted - attached 1841.patch
Added a couple sentences to documenation - Toby
-
repo owner - changed status to resolved
-
repo owner - changed milestone to 1.x.xx
- Log in to comment
In addition, the
text
type on SQL Server cannot compare items with an equals to (=
) operator...