Get the metadata for a table. Returns a list of tuples, one for
each column. Each tuple consists of the following:
(column_name, type_string, max_char_size, precision, scale, nullable)
The tuple elements have the following meanings.
- column_name
the name of the column
- type_string
the column type, as a string
- max_char_size
the maximum size for a character field, or None
- precision
the precision, for a numeric field; or None
- scale
the scale, for a numeric field; or None
- nullable
True if the column is nullable, False if it is not
The tuples are named tuples, so the fields may be referenced by the
names above or by position.
The default implementation uses the DB API's cursor.description
field. Subclasses are free to override this method to produce their
own version that uses other means.
- Parameters:
table - the table name for which metadata is desired
cursor - a Cursor object from a recent query
- Returns: list
- list of tuples, as described above
- Raises:
- Overrides:
base.DBDriver.get_table_metadata
- (inherited documentation)
|