{"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/244cde92a7df7f9b8b8b7a4075c35a12977e303e/bindings/react-native/src/Statement.ts#L359-L395","documentation":"Statement.readColumnValue() switches on the native rowValueKind() and only handles TursoType.NULL, INTEGER, REAL, TEXT and BLOB. Anything else - most notably TursoType.UNKNOWN (0) - hits the default branch and throws. The value's type code came back outside the set the JS side knows, which almost always means the JS package and the native binary disagree (e.g. a newer native layer, or a broken JSI read).","triggerScenarios":"stmt.get()/stmt.all() reading a row where rowValueKind() returns 0 (UNKNOWN) or a value not present in the JS TursoType enum; typically after upgrading the npm package without rebuilding the native module, or vice versa.","commonSituations":"Version skew between @tursodatabase/sync-react-native and the installed pods/gradle dependency; a native build from a different branch that numbers or extends the type enum differently.","solutions":["Rebuild the native side so it matches the npm package version: cd ios && pod install, or ./gradlew clean on Android, then reinstall the app (not just Metro reload)","Verify package.json and the native dependency pin the same release of the Turso RN SDK","If versions match and it persists on a specific query/value, print the kind number and file an issue - it identifies the exact unmapped type"],"exampleFix":"// before - version skew: JS enum has no value for what native returns\nconst rows = await stmt.all(); // throws `Unknown column type: 0`\n\n// after - lock both sides to one release and rebuild\n// package.json: \"@tursodatabase/sync-react-native\": \"0.x.y\"\n// ios: pod install ; android: ./gradlew clean && rebuild, then reinstall the app","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { rows = await stmt.all(); } catch (e) { if (e instanceof Error && e.message.startsWith('Unknown column type:')) { // type enum out of range -> native/JS skew, rebuild native throw new Error('Native module out of sync with JS package - rebuild with pod install / gradle clean'); } throw e; }","preventionTips":["Upgrade the npm package and the native pods/gradle dependency together in one change","After any SDK upgrade, do a clean native rebuild and reinstall before testing","Smoke-test one read and one write against a known table after upgrading to catch enum skew early"],"tags":["react-native","type-mapping","jsi","version-mismatch"],"backgroundTag":"native-enum-mismatch","analyzedSha":"244cde92a7df7f9b8b8b7a4075c35a12977e303e","analyzedAt":"2026-08-20T07:02:18.389Z","contentChangedAt":"2026-08-20T07:02:18.389Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}