Effect CommunityEC
Effect Community2y ago
5 replies
attila

Runtime Error with MYSQL8 After Migrating from @sqlfx/sql-mysql to @effect/sql-mysql2

FYI: after migrating from @sqlfx/sql-mysql (the mariadb implementation) to
@effect/sql-mysql2
, I've noticed a runtime error when using MYSQL8. When using MYSQL5.7, the issue was not present. The error reads:
SqlError: ER_WRONG_ARGUMENTS: Incorrect arguments to mysqld_stmt_execute
    at Packet.asError (/app/node_modules/mysql2/lib/packets/packet.js:728:17)
    at Execute.execute (/app/node_modules/mysql2/lib/commands/command.js:29:26)
    at PoolConnect...

You can read more about why this is happening in this mysql2 issue. My hotfix was to run yarn patch mysql2 and then make the change described here. This fix works for both versions of MYSQL.
Was this page helpful?