Closed opsb closed 8 months ago
@opsb Nice catch, thank you! I believe this could be the culprit https://github.com/prisma/prisma/issues/8478#issuecomment-1415834970 , but we are using version 4.8.x of Prisma, which is the same one Electric Javascript client is using for the Prisma introspection. I guess we could use the non Alpine version, although it's much heavier.
Before merging, could you try with prisma version 4.10 and Node Alpine and see if it works? Maybe it's safe to use 4.10 for Prisma, we can double check with the Electric team if there would be any problem running the introspection with that version.
I gave 4.10.0 a try with alpine and I don't see the original error but there's a different one
electric-1 | 16:21:36.839 pid=<0.3659.0> proxy_session_id=115 [error] Received unknown prisma introspection query: "SELECT tbl.relname AS table_name, namespace.nspname as namespace, tbl.relhassubclass\nFROM pg_class AS tbl\nINNER JOIN pg_namespace AS namespace ON namespace.oid = tbl.relnamespace\nWHERE\n ( -- grab tables when\n -- it's an oRdinary table ('r') and is not a partition;\n -- NOTE: CockroachDB puts NULLs in 'relispartition'\n (tbl.relkind = 'r' AND ((tbl.relispartition is NULL) OR tbl.relispartition = 'f'))\n OR -- when it's a partition\n tbl.relkind = 'p'\n )\n AND namespace.nspname = ANY ( $1 )\nORDER BY namespace, table_name;\n" with columns ["table_name", "namespace", "tbl.relhassubclass"]
Looks like prisma has made a change which the sync engine doesn't accommodate yet (at least in the latest version of the docker build anyway).
Ok, that was my worry. The Electric Migrations Proxy is designed around a particular behavior of the Prisma introspection, which doesn't seem to be compatible with version 4.10. Let's merge the non Alpine version then. Thank you!
Running
failed with the following error on my M1 mac machine.
Switching to the non-alpine image was enough to get it working.