K
Kysely9mo ago
djMax

How do you formulate a custom type argument?

I would like to pass a record type to a postgres function with kysely. How do I do that? I get "malformed record literal" when I try the obvious things. I'm sure I can raw-sql it together but I'd like to do it as properly as possible.
2 Replies
Igal
Igal9mo ago
Hey 👋🏻 A playground link would help us understand better what you're trying to do
djMax
djMax9mo ago
https://kyse.link/?p=s&i=STmJdHPmiE3OS3cyp4hj Not much there because kysely doesn't explicitly generate anything for functions or records, but I put the sql. I want to call that function. I made it work by changing the param to json and then doing
WITH cte AS (
SELECT x
FROM json_populate_recordset(NULL::identifier_detail, _jsonIdentifiers) AS x
)
WITH cte AS (
SELECT x
FROM json_populate_recordset(NULL::identifier_detail, _jsonIdentifiers) AS x
)
in the function, but... ewww.