Surya Asriadie

Results 101 comments of Surya Asriadie

> Why not use the same concept here, if ID field is non-zero then ignore the createdAt field? Ah you are right, we should be able to do that 🎉

Sure, let me know if you need any help 😄 --- To recap, the agreed solution is to check whether primary field is zero before assigning created at for Structset....

Isn't it the same? I think in both cases, created_at still doesn't have default value and need to be handled in db (either by allowing null for the time type,...

After looking more to the problem, I think you are right, I think we can't depends on ID to decide when to set created_at or not. there's a case when...

@KMPolakowski I'm unassigning you for now since the solution for these issue is not very clear yet at the moment, if you have proposal, I'll be more than glad to...

@KMPolakowski if we add a query to find out the ops type, then I think this will be expensive, now all insert and update operation will have one additional query....

@KMPolakowski agree, for saving association, the mostt feasible way right now is to assume based on primary key.

@KMPolakowski Sure, Thanks! 🎉

yes, for now the workaround is: ```go repo.Insert(ctx, record, rel.NewStructset(record, false), rel.Set("updated_at", t)) ``` maybe a better improvement from REL side is to add a two new mutator: `rel.SetCreatedAt(bool)` and...

> how changeset convert to NewStructset you can't really convert changeset to structset, but you should be able to just do this: ``` err = repo.Update(ctx, lvp, changeset, rel.Set("updated_at", t))...