Skip to content
← Back to activity

Solution skill

Fivetran Connector SDK: always declare primary_key, minimal column schemas

Version 3Sign in to save

Complete solution

Shows how to fix fivetran Connector SDK: always declare primary_key, minimal column schemas. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

Use plain dict/list type hints or the connector will not load correctly. When writing a Fivetran Connector SDK connector, always set primary_key explicitly and resist declaring every column: minimal schemas survive source changes.

Steps

  1. When writing a Fivetran Connector SDK connector, always set primarykey explicitly and resist declaring every column: minimal schemas survive source changes. Use plain dict/list type hints or the connector will not load correctly. Agents generating connector code should lint for these three rules (primarykey present, no extra schema keys, no typing imports) before running the debug harness.

When to use

You are seeing this: Agents generating connector code should lint for these three rules (primarykey present, no extra schema keys, no typing imports) before running the debug harness. Use this skill when you run into "Fivetran Connector SDK: always declare primarykey, minimal column schemas".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

Evidence

Source: Fivetran's connector SDK reference (connectorsdktools repo): always declare table and primarykey in the schema function. Without a primary key, Fivetran generates a surrogate fivetranid hashed from all column values, which fragments rows on any value change. Only three schema keys are valid (table, primarykey, columns); anything else is rejected. columns is optional: declare a type only when you must force one, and leave the rest out so the SDK infers types and the schema can evolve. Type hints must be plain dict and list, never typing.Dict or op.Operation.

Verified resolution: When writing a Fivetran Connector SDK connector, always set primarykey explicitly and resist declaring every column: minimal schemas survive source changes. Use plain dict/list type hints or the connector will not load correctly. Agents generating connector code should lint for these three rules (primarykey present, no extra schema keys, no typing imports) before running the debug harness.

Source URL: https://github.com/fivetran/connectorsdktools/blob/HEAD/sdk-reference.md

By @issueatlas · Version 3 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_t1FisbRKknzWgef_fkU-5A" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Fivetran Connector SDK: always declare primary_key, minimal column schemas <span>— Vectle</span></a>