{"record":{"id":"94207645627290c9","repo":"nanocoai/nanoclaw","slug":"nothing-to-update-provide-at-least-one-of-upd","errorCode":null,"errorMessage":"nothing to update — provide at least one of: ${updatableCols.map((c) => '--' + c.name.replace(/_/g, '-')).join(', ')}","messagePattern":"nothing to update — provide at least one of: (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/cli/crud.ts","lineNumber":327,"sourceCode":"function genericUpdate(def: ResourceDef) {\n  const updatableCols = def.columns.filter((c) => c.updatable);\n  const cols = visibleColumns(def).join(', ');\n  return async (args: Record<string, unknown>) => {\n    const id = args.id as string;\n    if (!id) throw new Error(`${def.name} id is required`);\n\n    const updates: Record<string, unknown> = {};\n    for (const col of updatableCols) {\n      const v = args[col.name];\n      if (v !== undefined) {\n        if (col.enum && !col.enum.includes(String(v))) {\n          throw new Error(`${col.name} must be one of: ${col.enum.join(', ')}`);\n        }\n        updates[col.name] = col.type === 'number' ? Number(v) : v;\n      }\n    }\n    if (Object.keys(updates).length === 0) {\n      throw new Error(\n        `nothing to update — provide at least one of: ${updatableCols.map((c) => '--' + c.name.replace(/_/g, '-')).join(', ')}`,\n      );\n    }\n\n    if (def.preUpdate) {\n      const current = await getDb().get<Record<string, unknown>>(\n        `SELECT ${cols} FROM ${def.table} WHERE ${def.idColumn} = ?`,\n        id,\n      );\n      if (!current) throw new Error(`${def.name} not found: ${id}`);\n      await def.preUpdate(updates, current);\n    }\n\n    const setClause = Object.keys(updates)\n      .map((k) => `${k} = @${k}`)\n      .join(', ');\n    const result = await getDb().run(`UPDATE ${def.table} SET ${setClause} WHERE ${def.idColumn} = @_id`, {\n      ...updates,","sourceCodeStart":309,"sourceCodeEnd":345,"githubUrl":"https://github.com/nanocoai/nanoclaw/blob/294ef2aee85218b23ad30eda9dfe10e590b54a8c/src/cli/crud.ts#L309-L345","documentation":"Thrown by genericUpdate in src/cli/crud.ts when the update args contain none of the resource's updatable columns — the UPDATE would be a no-op. The error enumerates every accepted flag so the caller can correct the invocation.","triggerScenarios":"`ncl <resource> update --id <id>` with no field flags, or with only non-updatable column flags (e.g. trying to change an id or created_at).","commonSituations":"Attempting to modify a computed/system column; scripts where the field flags failed to parse; misunderstanding which columns are mutable.","solutions":["Add at least one of the flags listed in the message","If the field you want is absent from the list, it is not updatable — use the dedicated command or accept it's immutable"],"exampleFix":"# before\nncl groups update --id my-group\n# after\nncl groups update --id my-group --personality friendly","handlingStrategy":"validation","validationCode":"const updatable = Object.keys(args).filter(k => k !== 'id' && updatableNames.includes(k));\nif (updatable.length === 0) { console.error('nothing to update'); process.exit(1); }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Skip the update call entirely when no fields changed","Only pass columns flagged updatable in the resource help"],"tags":["cli","no-op","crud"],"backgroundTag":"empty-update","analyzedSha":"294ef2aee85218b23ad30eda9dfe10e590b54a8c","analyzedAt":"2026-08-28T13:59:10.357Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}