search

Home  >  Q&A  >  body text

How to connect to Planetscale using Nestjs

<p>I used typeorm to create a Nest application that contains many tables in mysql. </p> <p>When I try to connect the database to planetscale, it shows the corresponding error: </p> <pre class="brush:php;toolbar:false;">[Nest] 9160 - 03/23/2023, 3:56:07AM **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)</pre> <p>When I try to connect it to the <strong>planetscale</strong> online database, I have many tables consisting of many rows, it shows these errors. </p> <p>Please help me handle this database connection without any errors...</p>
P粉311423594P粉311423594457 days ago448

reply all(1)I'll reply

  • P粉418214279

    P粉4182142792023-08-29 10:40:01

    According to the PlanetScale Github repository, there appears to be an update to fix this issue. In the meantime, I managed to solve the problem by adding the following code in the TypeOrmModule parameter of app.module as well as the configured DataSource.

    synchronize: false

    reply
    0
  • Cancelreply