Reputation: 1045
I hope the word "Types" is used correctly here. Perhaps I mean "Arguments". Feel free to edit.
I am creating a database using Models with Flask with SQLAlchemy, where can I find a list of all the different possible Column arguments such as:
account_id = db.Column(db.Integer, nullable=False)
I know some of the obvious types such as db.Integer
or db.String
. However I can't seem to find in the SQL Alchemy documentation, or the Flask documentation, a list of all possible arguments for creating a db.Column
instance. Am I looking wrong?
Is there a way of differentiating things like db.Integer
into tinyint, bigint, etc.?
As for options, such as the nullable=False
, I have had trouble finding a good list of all the possible options when creating a db.Column
instance.
Upvotes: 35
Views: 50339
Reputation: 136181
I think you're looking for the Column and Data Types page in the documentation. A little HTML parsing gives:
Upvotes: 63
Reputation: 130
Here what I found in sqlalchemy/types.py
https://github.com/zzzeek/sqlalchemy/blob/master/lib/sqlalchemy/types.py
Upvotes: 0
Reputation: 1808
Documentation is directly perceived through the senses, but if you still wanna see it in commandline, try some IDE, or just type this:
(normally our db
is just SQLALCHEMY()
)
>>> print dir(sqlalchemy.types)
["ARRAY","BIGINT","BINARY","BLOB","BOOLEAN","BigInteger","Binary","Boolean","CHAR","CLOB","Concatenable","DATE","DATETIME","DECIMAL","Date","DateTime","Enum","FLOAT","Float","INT","INTEGER","Indexable","Integer","Interval","JSON","LargeBinary","MatchType","NCHAR","NULLTYPE","NUMERIC","NVARCHAR","NullType","Numeric","PickleType","REAL","SMALLINT","STRINGTYPE","SchemaType","SmallInteger","String","TEXT","TIME","TIMESTAMP","Text","Time","TypeDecorator","TypeEngine","Unicode","UnicodeText","UserDefinedType","VARBINARY","VARCHAR","Variant"]
Upvotes: 31