Skip to main content

Squillify development is paused indefinitely. Read why, and discover what this experiment achieved. Read the story

MicroSkills Reference

Validate Primary Key

data.validate_primary_key

ProductionBounded custom (Class B)Deterministicstrictfastv1.0.0
No network

Overview

You send a rectangular table and 1 to 8 key columns. We report whether the key is unique and non-null, with duplicate and null counts. Diagnostics carry 0-based row indices and a SHA-256 fingerprint of the canonical key, never the key values. INTEGER 1 and NUMBER 1.0 stay distinct. This is not a database constraint and does not rewrite rows.

Printing duplicate keys into logs and tickets leaks identifiers. Fingerprints and row indices are enough to locate the row without repeating the value.

Reliability

Duplicates are success with valid false, not a typed failure. DUPLICATE_COLUMN — trigger: the table or keyColumns repeats a name; retryable: no; next: make names unique. SHAPE_INVALID — trigger: a row is not rectangular; retryable: no; next: fix that row. TYPE_MISMATCH — trigger: a cell does not match its declared type; retryable: no; next: fix the cell. ITEM_LIMIT_EXCEEDED — trigger: the table exceeds 1,000,000 cells; retryable: no; next: split the table. COLUMN_CONFLICT — trigger: a keyColumns entry is not in the table; retryable: no; next: send a column that exists.

Context footprint

Counts plus at most 500 fingerprint diagnostics. A successful call costs 1 execution credit.

When to use it

When 1 to 8 named columns must be unique and you need row indices plus a SHA-256 fingerprint rather than the key values themselves.

When you want duplicates deleted, or uniqueness that ignores INTEGER versus NUMBER.

Scope

Note
Verifies uniqueness of 1 to 8 columns and returns SHA-256 fingerprints instead of key values.

Non-goals

  • Does not create a database constraint
  • Does not drop or rewrite duplicate rows
  • Does not approximate uniqueness

Properties

IdempotentRetry safeStreaming supportedFile input supportedRequires external service

Capabilities

data-transformation

Cost & billing

Flat rate per invocation

MetercallsBillable onsuccessCost per call1 credit

File handling

Accepts file_refProduces file_refMax input2 MB

How we handle your data

Sensitive input, safe output
What this means

This skill may receive sensitive content, but it does not target sensitive data and returns only a structured non-sensitive result.

Squillify guarantees
  • Runs inside Squillify
  • This skill runs inside Squillify.
  • Payloads are not sent to an external service by this skill.
  • Squillify does not permanently store submitted payloads.
  • Telemetry records metadata only, not submitted content.
  • Submitted payloads are not used for training.
  • Submitted payloads are not reviewed by humans.
  • This skill does not target sensitive data.
  • The response does not contain submitted content.
Your responsibility

Squillify does not determine whether submitted content is sensitive. Your application is responsible for deciding what data it is allowed to submit. Your application is responsible for securing the response.

Read the Microskill Data Handling Policy

Input schema

FieldTypeRequiredDescription
tableobjectYesClosed rectangular table: typed columns plus row-major arrays of JSON scalars or null.
keyColumnsarrayYesFrom 1 through 8 unique NFC column names forming the key, in declared order.
nullsstringNoINVALID rejects null keys; DISTINCT treats them as unique. Omit it for INVALID.
caseSensitivitystringNoSENSITIVE compares as sent; UNICODE_CASEFOLD NFC-lowers with Locale.ROOT. Omit it for SENSITIVE.
maxViolationsintegerNoDiagnostic cap; omit it for 500.

Output schema

FieldTypeRequiredDescription
validbooleanYesTrue only when duplicateCount and nullCount are both 0.
duplicateCountintegerYesNon-negative count for this result.
nullCountintegerYesNon-negative count for this result.
violationCountintegerYesNon-negative count for this result.
truncatedbooleanYesTrue when diagnostics stopped at maxViolations.
rowCountintegerYesNon-negative count for this result.
diagnosticsarrayYesFrom 0 through 500 fingerprint diagnostics in scan order, never raw keys.

API contract

POST /v1/execute
curl
curl -sS -X POST "$BASE/v1/execute" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"skillKey":"data.validate_primary_key","input":{"table":{"columns":[{"name":"id","type":"STRING"}],"rows":[["a"],["b"]]},"keyColumns":["id"]}}'
Integrations
TypeScript SDK
import { Squillify } from "@squillify/sdk";

const sq = new Squillify({ apiKey: process.env.SQUILLIFY_API_KEY });

const { output } = await sq.execute("data.validate_primary_key", {"table":{"rows":[["a"],["b"]],"columns":[{"type":"STRING","name":"id"}]},"keyColumns":["id"]});

Errors

CodeHTTPRetryableDescription
VALIDATION_ERROR400NoThe request payload failed schema validation.
UNAUTHORIZED401NoMissing or invalid API key.
SKILL_NOT_ACCESSIBLE403NoThe API key is not granted access to this skill.
SKILL_NOT_AVAILABLE_FOR_PLAN403NoThis skill is not included in your current plan.
PLAN_ELIGIBILITY_UNAVAILABLE503YesPlan eligibility could not be decided. Retry after backoff.
SKILL_NOT_FOUND404NoThe requested skill or version does not exist.
TENANT_RATE_LIMITED429YesRequest rate limit exceeded. Retry after backoff.
QUOTA_EXCEEDED429YesPlan quota exhausted. Retryable once the quota period resets.
EXECUTION_TIMEOUT504YesExecution exceeded the allowed time budget.
DUPLICATE_COLUMN400NoThe request payload failed this skill's input validation.
SHAPE_INVALID400NoThe request payload failed this skill's input validation.
TYPE_MISMATCH400NoThe request payload failed this skill's input validation.
ITEM_LIMIT_EXCEEDED429NoA size, quota, rate, or time limit was exceeded.
COLUMN_CONFLICT400NoThe request payload failed this skill's input validation.

Other limits

LimitValue
Recommended inline bytes32 KiB

Limitations

  • Does not create a database constraint
  • Does not drop or rewrite duplicate rows
  • Does not approximate uniqueness
  • Deleting duplicates
  • Fuzzy or phonetic uniqueness

How to call

POST /v1/execute (requires authentication)

Request bodyjson
{
  "skillKey": "data.validate_primary_key",
  "input": {
    "table": {
      "rows": [
        [
          "a"
        ],
        [
          "b"
        ]
      ],
      "columns": [
        {
          "type": "STRING",
          "name": "id"
        }
      ]
    },
    "keyColumns": [
      "id"
    ]
  }
}

Examples

Two distinct string keys are valid

Inputjson
{
  "table": {
    "rows": [
      [
        "a"
      ],
      [
        "b"
      ]
    ],
    "columns": [
      {
        "type": "STRING",
        "name": "id"
      }
    ]
  },
  "keyColumns": [
    "id"
  ]
}
Expected outputjson
{
  "duplicateCount": 0,
  "truncated": false,
  "valid": true,
  "violationCount": 0,
  "diagnostics": [],
  "nullCount": 0,
  "rowCount": 2
}
Tip
Two different STRING keys produce valid true and empty diagnostics

Duplicate string key returns fingerprint

Inputjson
{
  "table": {
    "rows": [
      [
        "a"
      ],
      [
        "a"
      ]
    ],
    "columns": [
      {
        "type": "STRING",
        "name": "id"
      }
    ]
  },
  "keyColumns": [
    "id"
  ]
}
Expected outputjson
{
  "duplicateCount": 1,
  "truncated": false,
  "valid": false,
  "violationCount": 1,
  "diagnostics": [
    {
      "fingerprint": "b788d768c7ed152e2094e2fc155e009c32bf2195e5aded0626b209e8bdd05366",
      "code": "DUPLICATE_KEY",
      "severity": "ERROR",
      "rowIndices": [
        0,
        1
      ]
    }
  ],
  "nullCount": 0,
  "rowCount": 2
}
Tip
The diagnostic names rows 0 and 1 and a SHA-256 fingerprint, not the key
  • Prove an extract's id is unique before a load, without logging the ids
  • Distinguish INTEGER 1 from NUMBER 1.0 on a composite key

Avoid for

  • Deleting duplicates
  • Fuzzy or phonetic uniqueness

Composable with

Safety & privacy

  • Runs without calling any external service.
  • Your payloads are never stored permanently.
  • Telemetry captures metadata only — never your payload contents.
  • We never train models on your payloads.
  • No human reviews your payloads.

Tags

primary-keyvalidationdata