# Integer Key (IntegerPkGenerator)

The [Integer Key](/app/generation/generators/generator-reference/integer-key.md) generator generates integer values that are between 0 and 2^32 - 1. The input values must be in the range 0 to 2^31 - 1.

## Link object structure <a href="#generator-api-integer-key-link-object" id="generator-api-integer-key-link-object"></a>

The Integer Key generator does not support linking. It can be self-consistent, but not consistent with another column. You cannot configure differential privacy.

The `metadata` object is populated from the [`IntegerPkMetadata`](https://app.tonic.ai/apidocs/index.html#/models/IntegerPkMetadata) object, which includes:

* The minimum value.
* The maximum value.
* The underlying data type for the source values (for MySQL, MongoDB, and Amazon DynamoDB).

```json
{
  "schema": "string",
  "table": "string",
  "column": "string",
  "path": "string",  //JSON fields only
  "dataType": "string",  //MySQL, MongoDB, Amazon DynamoDB, and JSON fields only
  "metadata": {
    "presetId": "string",
    "generatorId": "IntegerPkGenerator",
    "min": integer,
    "max": integer,
    "rangeOption": "enum",
    "isConsistent": boolean,
    "encryptionProcessor": "x-on", //To use configured Structural data encryption
    "customValueProcessor": "string"  //If custom value processor is applied
  }
}
```

## Example replacement <a href="#generator-api-integer-key-replacement" id="generator-api-integer-key-replacement"></a>

In the following example replacement for the Integer Key generator, the generator produces a value between 10 and 20. The original values are Int64. Consistency is enabled.

```json
{
  "name": "id",
  "schema": "test"
  "table": "users",
  "links": [
    {
      "schema": "test",
      "table": "users",
      "column": "id",
      "metadata": {
        "presetId": "IntegerPkGenerator",
        "generatorId": "IntegerPkGenerator",
        "min": 10,
        "max": 20,
        "rangeOption": "Int64",
        "isConsistent": true
      }
    }
  ]
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.tonic.ai/app/api/quick-start-guide/tonic-api-generator-assignment/generator-api-reference/generator-api-ref-integer-key.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
