{"id":"6d0d6d7b2d3db450","repo":"typeorm/typeorm","slug":"sqlit-driver-does-not-support-change-comment","errorCode":null,"errorMessage":"sqlit driver does not support change comment.","messagePattern":"sqlit driver does not support change comment\\.","errorType":"exception","errorClass":"TypeORMError","httpStatus":null,"severity":"error","filePath":"src/driver/sqlite-abstract/AbstractSqliteQueryRunner.ts","lineNumber":2477,"sourceCode":"                : target\n        return tableName\n            .replaceAll(/^\\.+|\\.+$/g, \"\")\n            .split(\".\")\n            .map((i) => (disableEscape ? i : this.driver.escape(i)))\n            .join(\".\")\n    }\n\n    /**\n     * Change table comment.\n     *\n     * @param tableOrName\n     * @param comment\n     */\n    changeTableComment(\n        tableOrName: Table | string,\n        comment?: string,\n    ): Promise<void> {\n        throw new TypeORMError(`sqlit driver does not support change comment.`)\n    }\n}\n","sourceCodeStart":2459,"sourceCodeEnd":2480,"githubUrl":"https://github.com/typeorm/typeorm/blob/04ff4daedcf60fa4ffd0d5d33bbafaac1a9bbc96/src/driver/sqlite-abstract/AbstractSqliteQueryRunner.ts#L2459-L2480","documentation":"changeTableComment() on the SQLite query runner is a hard stub — SQLite does not support table comments in metadata (comments in SQLite are only allowed as SQL comments inside DDL and are not persisted as schema metadata). Any call throws. Note: the message contains a typo ('sqlit') in source.","triggerScenarios":"Calling queryRunner.changeTableComment(table, comment) on a SQLite DataSource; running a migration or entity subscriber that sets table comments without driver-awareness.","commonSituations":"Cross-driver code that sets comments for Postgres/MySQL and inadvertently runs against SQLite; entity metadata with comment fields synchronized via schema sync on SQLite; sharing migration logic across drivers.","solutions":["Gate the call on driver type: skip for sqlite/sqljs/better-sqlite3/expo/react-native.","Use SQL comments inside a custom DDL string if you need documentation in source, accepting they are not stored metadata.","Drop the comment from entity metadata when targeting SQLite.","Split comment-related migrations into a Postgres/MySQL-only set."],"exampleFix":"// before\nawait queryRunner.changeTableComment(\"user\", \"Application users\");\n// after\nif ([\"postgres\",\"mysql\",\"mariadb\"].includes(dataSource.options.type)) {\n  await queryRunner.changeTableComment(\"user\", \"Application users\");\n}","handlingStrategy":"type-guard","validationCode":"if (['postgres','mysql','mariadb'].includes(dataSource.options.type)) {\n  await queryRunner.changeTableComment(table, comment);\n}","typeGuard":"const supportsTableComment = (type: string) =>\n  ['postgres','mysql','mariadb','oracle','mssql'].includes(type);","tryCatchPattern":"try { await queryRunner.changeTableComment(t, c); }\ncatch (e) { if (/does not support change comment/.test((e as Error).message)) { /* skip on sqlite */ } else throw e; }","preventionTips":["Skip table-comment operations on SQLite family drivers.","Move comment changes into a driver-specific migration set.","Drop entity `comment` fields when targeting SQLite."],"tags":["sqlite","driver-compat","typeorm"],"analyzedSha":"04ff4daedcf60fa4ffd0d5d33bbafaac1a9bbc96","analyzedAt":"2026-08-03T18:27:32.281Z","schemaVersion":2}