{"record":{"id":"5e032465daa83153","repo":"tursodatabase/turso","slug":"unknown-column-type-kind","errorCode":null,"errorMessage":"Unknown column type: ${kind}","messagePattern":"Unknown column type: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"bindings/react-native/src/Statement.ts","lineNumber":377,"sourceCode":"    switch (kind) {\n      case TursoType.NULL:\n        return null;\n\n      case TursoType.INTEGER:\n        return this._statement.rowValueInt(index);\n\n      case TursoType.REAL:\n        return this._statement.rowValueDouble(index);\n\n      case TursoType.TEXT:\n        // Use rowValueText which directly returns a string from C++ (avoids encoding issues)\n        return this._statement.rowValueText(index);\n\n      case TursoType.BLOB:\n        return this._statement.rowValueBytesPtr(index) || new ArrayBuffer(0);\n\n      default:\n        throw new Error(`Unknown column type: ${kind}`);\n    }\n  }\n\n  /**\n   * Reset statement for re-execution\n   *\n   * @returns this for chaining\n   */\n  reset(): this {\n    if (this._finalized) {\n      throw new Error('Statement has been finalized');\n    }\n\n    this._statement.reset();\n    return this;\n  }\n\n  /**","sourceCodeStart":359,"sourceCodeEnd":395,"githubUrl":"https://github.com/tursodatabase/turso/blob/bad083fafbefdeae9a42ec19bdaaad8918dcf411/bindings/react-native/src/Statement.ts#L359-L395","documentation":"Statement.readColumnValue() switches on the native rowValueKind(index) over TursoType NULL, INTEGER, REAL, TEXT, and BLOB; the default arm throws for any other value. NULL is explicitly handled (returns null), so this is not a null-value problem — it means the native side returned a kind integer the JS enum does not know, typically UNKNOWN (0) or a value from a newer native build.","triggerScenarios":"JS TursoType enum (types.ts) out of sync with the native rowValueKind implementation — e.g. the native module was rebuilt from newer source that emits a new type code while the JS package is older; rowValueKind returning 0/UNKNOWN because the row cursor is not positioned on a valid row.","commonSituations":"Partial upgrades: bumping the npm package but not running pod install, or vice versa; monorepos where multiple app shells build the native module from different checkouts; nightly/native canary builds.","solutions":["Rebuild native (pod install / clean gradle) and ensure the npm package version matches the native module revision","Clear Metro and native build caches after upgrading","Log the kind value in a catch to confirm which code the native side returned","If versions are aligned and a valid row still produces it, report it as a binding bug with the query and value"],"exampleFix":"// before\nconst rows = await stmt.all(); // reading a row throws: Unknown column type: 7\n\n// after (diagnostic wrapper to capture the offending kind)\ntry {\n  const rows = await stmt.all();\n} catch (e) {\n  console.error('kind reported by native:', /type: (\\d+)/.exec(e.message)?.[1]);\n  throw e;\n}\n// then: cd ios && pod install && npx react-native start --reset-cache","handlingStrategy":"try-catch","validationCode":null,"typeGuard":"function isUnknownColumnTypeError(e: unknown): boolean {\n  return e instanceof Error && /Unknown column type: \\d+/.test(e.message);\n}","tryCatchPattern":"try {\n  const rows = await stmt.all();\n} catch (e) {\n  if (isUnknownColumnTypeError(e)) {\n    const kind = Number(/type: (\\d+)/.exec(e.message)[1]);\n    // kind from a newer native build → rebuild/align versions; do not swallow\n    throw new Error(`JS/native type enum out of sync (native kind ${kind}) — rebuild native module`);\n  }\n  throw e;\n}","preventionTips":["Treat any 'Unknown column type' as a version-skew smell: rebuild native immediately","Keep npm package, pods, and gradle artifacts locked to the same release","Clear Metro and native caches when switching branches/tags of the SDK"],"tags":["type-decoding","version-skew","jsi","react-native"],"backgroundTag":"binding-version-mismatch","analyzedSha":"bad083fafbefdeae9a42ec19bdaaad8918dcf411","analyzedAt":"2026-08-16T23:12:11.798Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}