Package mysql :: Module result :: Class Field
[hide private]
[frames] | no frames]

Class Field



The description of a column in a SELECT query.

Instance Methods [hide private]
  __repr__(...)
  is_not_null(...)
Determine if this is a NOT NULL column.
  is_numeric(...)
Determine if this column is a numeric type.
  is_primary_key(...)
Determine if this column has a primary key.

Instance Variables [hide private]
  catalog = ''
The catalog name.
  charset_number = 0
The character set number for the field.
  db = ''
The name of the database that the field comes from.
  decimals = 0
The number of decimals for numeric fields.
  default = ''
The default value of this field.
  flags = 0
Different bit-flags for the field.
  length = 0
The width of the field, as specified in the table definition.
  max_length = 0
The maximum width of the field for the result set (the length of the longest field value for the rows actually in the result set).
  name = ''
The name of the field.
  org_name = ''
The name of the field.
  org_table = ''
The name of the table.
  table = ''
The name of the table containing this field, if it isn't a calculated field.
  type = 0
The type of the field (from mysql.constants.field_types).

Method Details [hide private]

__repr__(...)
(Representation operator)

 

is_not_null(...)

 

Determine if this is a NOT NULL column.
Returns:
Returns True if this column is defined NOT NULL. Returns False if the column allows NULLs.

is_numeric(...)

 

Determine if this column is a numeric type.
Returns:
Returns True if this column is a numeric type, False otherwise.

is_primary_key(...)

 

Determine if this column has a primary key.
Returns:
Returns True if this column is a primary key, False if not.

Instance Variable Details [hide private]

catalog


The catalog name. This value is always "def".
Value:
''                                                                     
      

charset_number


The character set number for the field.
Value:
0                                                                     
      

db


The name of the database that the field comes from. If the field is a calculated field, db is an empty string.
Value:
''                                                                     
      

decimals


The number of decimals for numeric fields.
Value:
0                                                                     
      

default


The default value of this field. This is currently always None.
Value:
''                                                                     
      

flags


Different bit-flags for the field. The flags value may have zero or more bits set that are defined in mysql.constants.field_flags.
Value:
0                                                                     
      

length


The width of the field, as specified in the table definition. For integers, this is the space required to store the value as a string. For BLOB or TEXT fields, it is the maximum size of the field.
Value:
0                                                                     
      

max_length


The maximum width of the field for the result set (the length of the longest field value for the rows actually in the result set). For integers, this is the space required to store the value as a string.

If you use set store_result to True, this contains the maximum length for the field. Otherwise the value of this variable is zero.

For statements, this is not set unless mysql.stmt.Statement.set_update_max_length is called on the statement object.

Value:
0                                                                     
      

name


The name of the field. If the field was given an alias with an AS clause, the value of name is the alias.
Value:
''                                                                     
      

org_name


The name of the field. Aliases are ignored.
Value:
''                                                                     
      

org_table


The name of the table. Aliases are ignored.
Value:
''                                                                     
      

table


The name of the table containing this field, if it isn't a calculated field. For calculated fields, the table value is an empty string. If the table was given an alias with an AS clause, the value of table is the alias.
Value:
''                                                                     
      

type


The type of the field (from mysql.constants.field_types).
Value:
0