Where can I find a list of the Flask SQLAlchemy Column types and options?

Question:

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.

Asked By: k4kuz0

||

Answers:

I think you’re looking for the Column and Data Types page in the documentation.
A little HTML parsing gives:

  • ARRAY
  • BIGINT
  • BINARY
  • BLOB
  • BOOLEAN
  • BigInteger
  • Boolean
  • CHAR
  • CLOB
  • Concatenable
  • DATE
  • DATETIME
  • DECIMAL
  • Date
  • DateTime
  • Enum
  • FLOAT
  • Float
  • INT
  • INTEGER
  • Integer
  • Interval
  • LargeBinary
  • MatchType
  • NCHAR
  • NVARCHAR
  • Numeric
  • PickleType
  • REAL
  • SMALLINT
  • SchemaType
  • SmallInteger
  • String
  • TEXT
  • TIME
  • TIMESTAMP
  • Text
  • Time
  • TypeDecorator
  • TypeEnginBases
  • TypeEngine
  • Unicode
  • VARBINARY
  • VARCHAR
Answered By: Adam Matan

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"]
Answered By: Sinux
Answered By: Samuel Ev