1.4.8.1 The Types Cache

The types cache is a dictionary of dictionaries stored in the _typesCache attribute of the cursor. Each key of the main dictionary is a table name in uppercase. Each value of each key is a dictianry of uppercase column name keys and Integer column type values. The integer values relate to the field types stored in Fields object described in the previous section.

For example below is the types cache for one of the examples:

{
    'ADDRESS_CAR': {
        'CARS': 3,
        'ADDRESSES': 3
    },
    'PERSON': {
        'NAME': 253,
        'ROWID': 3
    },
    'CAR': {
        'TYPE': 253,
        'ROWID': 3
    },
    'ADDRESS': {
        'PERSON': 3,
        'ROWID': 3,
        'ADDRESS': 253
    }
}

Part of the types cache can be specified in the cursor constructor. The part specified will be merged with the rest of the types cache. This is so that if desired, a few SQL calls can be saved by specifying the cache in advance. The mergeTypes() method can also be used to merge type information into the types cache.

See About this document... for information on suggesting changes.