xuuexu
2020-2-22 08:56:39

@xuuexu has joined the channel


xuuexu
2020-2-22 09:40:57

Hi, are there any examples about using yaml pkg, I only saw a few at official doc


chris613
2020-2-22 18:33:50

@popa.bogdanp sorry tp bug you, but i cant seem to get update-one! to work with the deta lib (sqlite) everything i try ends up with #f am i missing something very simple ?


chris613
2020-2-22 18:36:09

never mind, i think ive solved it. you cant update unless the entity itself was actually pulled from the database.


chris613
2020-2-22 18:36:54

its not possible to create a new entity with an existing up and then “update” the entity with that id


popa.bogdanp
2020-2-22 18:47:31

That’s right, you have to look it up and then change it so its #<meta> gets in the right state.


popa.bogdanp
2020-2-22 19:02:58

The reason for this is that deta actually tracks changes to the field level so that it only updates the fields it needs to for each entity.

https://github.com/Bogdanp/deta/blob/master/deta-lib/query.rkt#L133


chris613
2020-2-22 20:18:26

yeah makes sense, just caught me out b/c i was feeding the entity into a UI “form” and returning a newly created entity at the point i was ready to comit rather than keeping the same object arround the whole time sort of thing