Kristian Notari
Explore posts from serversError "isSelectQueryBuilder" while using doUpdateSet on conflict
Also, giving the ability to reference excluded columns which are not part of the values expression result in NULL being set for those columns during the do update set, which is not what you'd expect it to do I guess.
As an example:
16 replies
Error "isSelectQueryBuilder" while using doUpdateSet on conflict
Wait a second, the excluded table get added in the db type for the onConflictBuilder based on the schema of the to be modified table, but it should really be typed based on the actual values table I'm putting in the values expression, or not?
16 replies
Error "isSelectQueryBuilder" while using doUpdateSet on conflict
From my understanding whenever you’re working with in database operations like the update set clause within an on conflict the type of the value you expect needs to be the update one. But eb.ref get the select one coming from the excluded.col right?
16 replies
Error "isSelectQueryBuilder" while using doUpdateSet on conflict
I’m assuming since eb.ref reference a column for example that you grab the select type of the given in memory table where the referenced column is, the excluded table in this case
16 replies
Error "isSelectQueryBuilder" while using doUpdateSet on conflict
My specific usecase doesn’t have Date and string. I have a jsonb column and pg underneath automatically transform that on selections to a json-like data structure which comes handy. But when updating/inserting, if it comes from json-like primitive data structure like a string or a number it doesn’t get encoded back to json on the pg level, so the database is getting a normal varchar/text parameter which if not properly json encoded will throw an error trying to work with jsonb columns
16 replies
Error "isSelectQueryBuilder" while using doUpdateSet on conflict
This works fine instead, if the select type matches the insert/update type:
https://kyse.link/?p=s&i=6fFLOsEIQ2yBNiKmGbt3
16 replies