Returns either the primary key value, or a tuple containing the primary key values in the
    case of a composite primary key.
357208
def primary_key(self):
    
    pkname = self.primary_key_name
    if pkname is None:
      return None
    elif isinstance(pkname, str):
      return getattr(self, pkname)
    else:
      return tuple((getattr(self, pkn) for pkn in pkname))
842655
def primary_key_tuple(self, item):
        
        if self.range_key is None:
            return (item[self.hash_key.name],)
        else:
            return (item[self.hash_key.name], item[self.range_key.name])
638230
def primary_key(self, hkey, rkey=None):
        
        if isinstance(hkey, dict):

            def decode(val):
                """ Convert Decimals back to primitives """
                if isinstance(val, Decimal):
                    return float(val)
                return val

            pkey = {self.hash_key.name: decode(hkey[self.hash_key.name])}
            if self.range_key is not None:
                pkey[self.range_key.name] = decode(hkey[self.range_key.name])
            return pkey
        else:
            pkey = {self.hash_key.name: hkey}
            if self.range_key is not None:
                if rkey is None:
                    raise ValueError("Range key is missing!")
                pkey[self.range_key.name] = rkey
            return pkey
227031
def static_record_lookup_key(value)#:nodoc:
      if value.is_a? self
        static_record_lookup_key(
          value.send(
            acts_as_static_record_options[:lookup_key] ||
            acts_as_static_record_options[:key] ||
            primary_key
          )
        )
      else
        value.to_s.gsub(' ', '_').gsub(/\W/, "").underscore
      end
    end
1322655
protected function _primaryKeyValue()
    {
        $fields = (array)$this->_table()->getPrimaryKey();
        $values = [];
        foreach ($fields as $field) {
            $values[] = $this->_deriveFieldFromContext($field);
        }

        if (count($values) === 1) {
            return $values[0];
        }

        return $values;
    }
18194
def read(self, primary_key):
    
        ''' 
             
        '''
        
        title = '%s.read' % self.__class__.__name__
        
    # retrieve record object
        # record_object = self.session.query(self.record).filter_by(id=primary_key).first()
        select_statement = self.table.select(self.table.c.id==primary_key)
        record_object = self.session.execute(select_statement).first()
        if not record_object:
            raise ValueError('%s(primary_key=%s) does not exist.' % (title, primary_key))
        
    # reconstruct record details
        record_details = self._reconstruct_record(record_object)
                    
        return record_details
529446
def primary_key(table)
      query = <<-SQL
        SELECT
          pg_attribute.attname,
          format_type(pg_attribute.atttypid, pg_attribute.atttypmod)
        FROM
          pg_index, pg_class, pg_attribute, pg_namespace
        WHERE
          pg_class.oid = $2::regclass AND
          indrelid = pg_class.oid AND
          nspname = $1 AND
          pg_class.relnamespace = pg_namespace.oid AND
          pg_attribute.attrelid = pg_class.oid AND
          pg_attribute.attnum = any(pg_index.indkey) AND
          indisprimary
      SQL
      row = execute(query, [table.split(".", 2)[0], quote_ident_full(table)])[0]
      row && row["attname"]
    end
393799
def primary_key(cls):
        

        if cls.__from_class__:
            cls = cls.__from_class__
        return cls.__table__.primary_key.columns.values()[0].name
450683
def get(self, key, default=None, cast=True):
        
        tablename, _, key = key.rpartition(':')
        if tablename and tablename not in self.fields.name.split('+'):
            raise ItsdbError('column requested from wrong table: {}'
                             .format(tablename))
        try:
            index = self.fields.index(key)
            value = list.__getitem__(self, index)
        except (KeyError, IndexError):
            value = default
        else:
            if cast:
                field = self.fields[index]
                value = _cast_to_datatype(value, field)
        return value
240463
def id(cls):
        
        if cls.__uuid_primary_key__:
            return immutable(Column(UUIDType(binary=False), default=uuid_.uuid4, primary_key=True, nullable=False))
        else:
            return immutable(Column(Integer, primary_key=True, nullable=False))
365045
def suitability_as_key(self, key_name):
        
        pk_values = all_values_for(self, key_name)
        if not pk_values:
            return ('absent', int)  # could still use it
        key_type = type(th.best_coercable(pk_values))
        num_unique_values = len(set(pk_values))
        if num_unique_values < len(pk_values):
            return (False, None)     # non-unique
        if num_unique_values == len(self):
            return (True, key_type)  # perfect!
        return ('partial', key_type)
738358
def get(self, key):
        

        if isinstance(key, tuple):
            # TODO handle different ordering
            try:
                x, y = float(key[0]), float(key[1])
            except IndexError:
                raise ValueError("Two values are required for a coordinate pair")

            except ValueError:
                raise ValueError("Only float or float-coercable values can be passed")

            key = "{0},{1}".format(x, y)

        return self[self.lookups[key]]
1210120
public SQLProperty getPrimaryKey() {
		for (SQLProperty item : collection) {
			if (item.isPrimaryKey()) {
				return item;
			}
		}

		// try to get id
		SQLProperty id = findPropertyByName("id");

		return id;
	}
896685
public static <T extends Enum<T>> T getEnumValue(String primaryKey, Class<T> enumClazz) {
        String val = (String) CFG.get(primaryKey);
        if (val == null) {
            throw new SofaRpcRuntimeException("Not Found Key: " + primaryKey);
        } else {
            return Enum.valueOf(enumClazz, val);
        }
    }
368785
def _get_value(data_structure, key):
    
    if len(key) == 0:
        raise KeyError()
    value = data_structure[key[0]]
    if len(key) > 1:
        return _get_value(value, key[1:])
    return value
290488
def primaryKeys(self, table, catalog=None, schema=None):  # nopep8
        """"""
        fut = self._run_operation(self._impl.primaryKeys, table,
                                  catalog=catalog, schema=schema)
        return fut
385411
public Object get(String key) {
        Object curEntry = primaryTable.get(key);
        return curEntry;
    }