docs: def get_constraints(self, cursor, table_name):
          """
          Retrieves any constraints or keys (unique, pk, fk, check, index)
          across one or more columns.
  
          Returns a dict mapping constraint names to their attributes,
          where attributes is a dict with keys:
           * columns: List of columns this covers
           * primary_key: True if primary key, False otherwise
           * unique: True if this is a unique constraint, False otherwise
           * foreign_key: (table, column) of target, or None
           * check: True if check constraint, False otherwise
           * index: True if index, False otherwise.
           * orders: The order (ASC/DESC) defined for the columns of indexes
           * type: The type of the index (btree, hash, etc.)
          """
          result = {}
          for field in self.table_description_cache(table_name)['fields']:
              if field['type'] in ('id', 'reference') or field['unique']:
                  result[field['name']] = dict(
                      columns=[field['name']],
                      primary_key=(field['type'] == 'id'),
                      unique=field['unique'],
                      foreign_key=(field['referenceTo'], 'id'),
                      check=False,
                  )
          return result