Budibase/budibase · error · Error

External tables with no `primary` column set will define an

Error message

External tables with no `primary` column set will define an `id` column, but we found an `id` column in the supplied schema. Either set a `primary` column or remove the `id` column.

What it means

Error "External tables with no `primary` column set will define an `id` column, but we found an `id` column in the supplied schema. Either set a `primary` column or remove the `id` column." thrown in Budibase/budibase.

Source

Thrown at packages/server/src/sdk/workspace/tables/external/index.ts:50

import datasourceSdk from "../../datasources"
import * as viewSdk from "../../views"
import { getTable } from "../getters"
import { ensureValidPrimaryDisplay } from "../utils"
import { populateExternalTableSchemas } from "../validation"

const DEFAULT_PRIMARY_COLUMN = "id"

function noPrimaryKey(table: Table) {
  return table.primary == null || table.primary.length === 0
}

function validate(table: Table, oldTable?: Table) {
  if (
    !oldTable &&
    table.schema[DEFAULT_PRIMARY_COLUMN] &&
    noPrimaryKey(table)
  ) {
    throw new Error(
      "External tables with no `primary` column set will define an `id` column, but we found an `id` column in the supplied schema. Either set a `primary` column or remove the `id` column."
    )
  }

  if (hasTypeChanged(table, oldTable)) {
    throw new Error("A column type has changed.")
  }

  const autoSubTypes = Object.values(AutoFieldSubType)
  // check for auto columns, they are not allowed
  for (let [key, column] of Object.entries(table.schema)) {
    // this column is a special case, do not validate it
    if (key === DEFAULT_PRIMARY_COLUMN) {
      continue
    }
    // the auto-column type should never be used
    if (column.type === FieldType.AUTO) {
      throw new Error(

View on GitHub (pinned to a81a902e9a)

When it happens

Trigger: Thrown at packages/server/src/sdk/workspace/tables/external/index.ts:50 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of Budibase/budibase@a81a902e9a (2026-08-29). Data as JSON: /api/errors/9048f110aaf2a219. Report an issue: GitHub.