我使用 typeorm 创建了一个 Nest 应用程序,其中包含 mysql 中的许多表。
当我尝试将数据库连接到planetscale时,它显示相应的错误:
[Nest] 9160 - 03/23/2023, 3:56:07 AM **ERROR [ExceptionHandler] can't push predicates on concatenate**
QueryFailedError: **can't push predicates on concatenate**
at Query.onResult (/workspaces/result-gen/src/driver/mysql/MysqlQueryRunner.ts:222:33)
at Query.execute (/workspaces/result-gen/node_modules/mysql2/lib/commands/command.js:36:14)
at PoolConnection.handlePacket (/workspaces/result-gen/node_modules/mysql2/lib/connection.js:488:32)
at PacketParser.onPacket (/workspaces/result-gen/node_modules/mysql2/lib/connection.js:94:12)
at PacketParser.executeStart (/workspaces/result-gen/node_modules/mysql2/lib/packet_parser.js:75:16)
at TLSSocket.<anonymous> (/workspaces/result-gen/node_modules/mysql2/lib/connection.js:387:25)
at TLSSocket.emit (node:events:512:28)
at addChunk (node:internal/streams/readable:324:12)
at readableAddChunk (node:internal/streams/readable:297:9)
at TLSSocket.Readable.push (node:internal/streams/readable:234:10)
当我尝试将其连接到 planetscale 在线数据库时,我有许多表由许多行组成,它显示了这些错误。
请帮助我处理此数据库连接,不要出现任何错误...
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
根据 PlanetScale Github 存储库,似乎有修复此问题的方法更新。与此同时,我设法通过在
app.module的TypeOrmModule参数以及配置的 DataSource 中添加以下代码来解决这个问题。