Use String Functions within DQL to do upserts and transform data on server side without client script.
What you actually did
Started this Topic After I double checked and searched the docs again and searched this forum for âString Functionsâ
Why that wasnât great, with examples
Because there are not any string functions. I understand the GraphQL experience with Dgraph, but when I want to do data work behind the generated API, it becomes difficult. This makes me miss my relational database. Wish to not be reminded of that time in my life, lol.
I would like to not need an external script everytime I just want to do onetime actions. This causes much frustration for me.
I will add a use case while I am staring at a tough solution without String Functions.
I have a Contact type that stores the first name and last name as separate predicates. This is the standard for most CRMs. Now trying to find a contact given a full name, âAnthony Masterâ, becomes quite difficult.
I do not want all of the firstName Anthonyâs with a different last name, and I donât want all of the Master family who isnât Anthony. So I have to separate the text on the client side and apply two different filters: firstName=Antony & lastName=Master.
This issue amplifies as more UIs are built around the same db. (That is the future of our this db serving many different UIs) Now every UI has to have the equivalence of taking the full name and dividing it up and sending it to the db.
This can be solved with upcoming hooks, but I would really like it in the lower level of the db itself and not rely on a custom built hook. Although I see many hooks in my future. Maybe I should buy a tackle box to keep up with all of them.
I know the dilemma seems smaller than what I am making it, but I am just used to being able to do database side concatenation and comparison. It makes the UI footprint smaller and transfers the workload to the database. With modern computing and advances in client side tech, this problem is diminished, until we look at the rise of chromebooks and other streamlined clients that donât offer much processing at all. We have the strongest man in the world, and we are making the 10 year old boy have to carry his backpack? I want to let the stronger device to the heavy lifting.