Effect CommunityEC
Effect Community•7mo ago•
44 replies
Kristian Notari

Error with Effect-SQL and Kysely Integration When Inserting Specific POJO

Big fan of kysely here. Trying effect-sql with kysely integration (https://github.com/Effect-TS/effect/tree/main/packages/sql-kysely) but encountered a strange error (I already reported that to kysely discord but they say there could be some patching thing going on with the effect library, not their fault 99%. Here's the error:

With 0.28.2, I'm having a strange issue which always occur with a specific value being inserted. I tried removing plugins, but that didn't help either.

the error:
TypeError: 'get' on proxy: property '0' is a read-only and non-configurable data property on the proxy target but the proxy did not return its actual value (expected '#<Object>' but got '#<Object>')


The query:
db.insertInto(config.table).values(chunk).onConflict(oc => config.onConflict(oc)).returning(`$uuid`)


Where chunk is an array of POJOs with 3 properties. I have a custom onConflict callback but even without it, the query still fails.

The strange thing about it, is that it only happens when I insert a particular POJO. I tried chunking the insert into only 1 POJO at a time, and it works for every POJO except for a particular one, which of course, has nothing different from others... (can't show the actual values though).

Example values:
{
   uuid: "43cacb0b-8786-4beb-b57a-f1099cf876fa",
   status: "CHECKING",
   priority: "1748610457.000000"
}


Follows stacktrace:
Was this page helpful?