# HStore Mask (HStoreMaskGenerator)

The [HStore Mask](/app/generation/generators/generator-reference/hstore-mask.md) generator runs selected generators on specified key values in an HStore column in a PostgreSQL database. HStore columns contain a set of key-value pairs.

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

For the HStore Mask generator, there is a link object for each path expression value to assign a generator to.

The generator does not itself support consistency or differential privacy.

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

* `pathExpression`, which is the path expression that identifies the value to apply the sub-generator to.
* The `subGeneratorMetadata` object, which identifies and configures the sub-generator.

<pre class="language-json" data-overflow="wrap"><code class="lang-json">{
  "schema": "string",
  "table": "string",
  "column": "string",
  "metadata": {
    "generatorId": "HStoreMaskGenerator",
    "presetId": "string",
    "customValueProcessor": "string",  //If custom value processor assigned to the generator
    "pathExpression": "string",
    "subGeneratorMetadata": {
      "generatorId": "string",
      "presetId": "string",
      //Metadata for the selected sub-generator
<strong>      "customValueProcessor": "string" //If custom value processor assigned to the sub-generator
</strong>    }
  }
}
</code></pre>

## Example replacement <a href="#generator-api-hstore-mask-replacement" id="generator-api-hstore-mask-replacement"></a>

In the following example replacement for the HStore Mask generator:

* The Random Integer generator is assigned to the value of the `pages` path expression. The generator uses values between 300 and 500.
* The Character Scramble generator is assigned to the value of the `title` path expression. Consistency is disabled.

```json
{
  "name": "hstore_col",
  "schema": "public",
  "table": "books",
  "links": [
    {
      "schema": "public",
      "table": "books",
      "column": "book_details",
      "metadata": {
        "generatorId": "HStoreMaskGenerator",
        "presetId": "HStoreMaskGenerator",
        "pathExpression": "pages",
        "subGeneratorMetadata": {
          "presetId": "RandomIntegerGenerator",
          "generatorId": "RandomIntegerGenerator",
          "min": 300,
          "max": 500
        }
      }
    },
    {
      "column": "book_details",
      "table": "books",
      "schema": "public",
      "metadata": {
        "generatorId": "HStoreMaskGenerator",
        "presetId": "HStoreMaskGenerator",
        "pathExpression": "title",
        "subGeneratorMetadata": {
          "isConsistent": false,
          "presetId": "TextMaskGenerator",
          "generatorId": "TextMaskGenerator"
        }
      }
    }
  ]
}
```


---

# 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-hstore-mask.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.
