Get primary key value.
432598
public function getPrimaryKeyValue()
    {
        //
        $key = static::getPrimaryKey();

        //
        return $key
            && isset($this->{$key})
            ? $this->{$key}
            : null;
    }
222761
def get_pks(self, field_vals):
        """"""
        field_name = self.schema.pk.name
        return self.in_field(field_name, field_vals).get()
1224175
public function primaryKey()
    {
        $primaryKeys = [];
        foreach ($this->_columns as $name => $data) {
            if ((!array_key_exists('primaryKey', $data)) || ($data['primaryKey'] !== true)) {
                continue;
            }

            $primaryKeys[] = $name;
        }

        return $primaryKeys;
    }
129956
def get(self, key, default=None):
        """"""
        if key not in self.table:
            return default

        return self[key]
959231
function GetPrimaryKeyName($remove_prefix = true)
	{
		foreach ($this->PrimaryKeys as $key)
		{
			return ($remove_prefix) ? $this->RemovePrefix($key->KeyColumn) : $key->KeyColumn;
		}
		
		// views don't technically have a primary key but we will return the first column if anybody asks
		if ($this->IsView) return $this->GetColumnNameByIndex(0,$remove_prefix);
	}
1130264
public static String getStringValue(String primaryKey, String secondaryKey) {
        String val = (String) CFG.get(primaryKey);
        if (val == null) {
            val = (String) CFG.get(secondaryKey);
            if (val == null) {
                throw new SofaRpcRuntimeException("Not found key: " + primaryKey + "/" + secondaryKey);
            } else {
                return val;
            }
        } else {
            return val;
        }
    }
486656
def collections(record, key, value):
    """"""
    return {
        'primary': value.get('a'),
        'secondary': value.get('b'),
        'deleted': value.get('c'),
    }
97684
def primary_key(self):
        
        primary_key = self.__current_descriptor.get('primaryKey', [])
        if not isinstance(primary_key, list):
            primary_key = [primary_key]
        return primary_key
1153280
public function getPrimaryKeyMetadata(): ?ColumnMetadata
    {
        $filteredColumnList = array_filter($this->columnMetadataList, function (ColumnMetadata $columnMetadata) {
            return $columnMetadata->isPrimaryKey();
        });

        return (count($filteredColumnList)) ? current($filteredColumnList) : null;
    }
320026
def _pk(self, obj):
        
        pk_values = tuple(getattr(obj, c.name)
                          for c in obj.__mapper__.primary_key)
        if len(pk_values) == 1:
            return pk_values[0]
        return pk_values
309261
public static function getMainField()
    {
        //
        $attribute = 'MainField';

        // retrieve value from class setting definition
        if (!static::hasClassAttribute($attribute)) {
            $mainField = null;

            //
            $schema = static::getSchema();

            //
            foreach ($schema as $field => &$attributes) {
                if ($attributes['Key'] == 'PRI') {
                    continue;
                }

                //
                $mainField = $field;

                //
                break;
            }

            // store as setting for future request
            static::setClassAttribute($attribute, $mainField);
        }

        // return primary key field name
        return static::getClassAttribute($attribute);
    }
557424
def given(self):
        """"""
        if self._primary.value[0] and self._primary.value[2]:
            return self._primary.value[0] + ' ' + self._primary.value[2]
        return self._primary.value[0] or self._primary.value[2]
839377
public String getPrimaryKeysString() {

        String result = "";

        for (int i = 0; i < primaryKeys.length; i++) {
            if (result != "") {
                result += ", ";
            }

            result += primaryKeys[i];
        }    // end of for (int i=0; i<primaryKeys.length; i++)

        return result;
    }
675888
def get_primary_keys(conn, table: str, schema='public'):
    """"""

    query = """\
SELECT
  c.constraint_name AS pkey_constraint_name,
  c.column_name     AS column_name
FROM
  information_schema.key_column_usage AS c
  JOIN information_schema.table_constraints AS t
    ON t.constraint_name = c.constraint_name
       AND t.table_catalog = c.table_catalog
       AND t.table_schema = c.table_schema
       AND t.table_name = c.table_name
WHERE t.constraint_type = 'PRIMARY KEY'
  AND c.table_schema=%s
  AND c.table_name=%s
ORDER BY c.ordinal_position"""

    for record in select_dict(conn, query, params=(schema, table)):
        yield record['column_name']
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
1154477
public static boolean getBooleanValue(String primaryKey, String secondaryKey) {
        Object val = CFG.get(primaryKey);
        if (val == null) {
            val = CFG.get(secondaryKey);
            if (val == null) {
                throw new SofaRpcRuntimeException("Not found key: " + primaryKey + "/" + secondaryKey);
            }
        }
        return Boolean.valueOf(val.toString());
    }
944190
public static int getIntValue(String primaryKey, String secondaryKey) {
        Object val = CFG.get(primaryKey);
        if (val == null) {
            val = CFG.get(secondaryKey);
            if (val == null) {
                throw new SofaRpcRuntimeException("Not found key: " + primaryKey + "/" + secondaryKey);
            }
        }
        return Integer.parseInt(val.toString());
    }