Andrew Thornton zeripath
  • Joined on
Loading Heatmap…

zeripath commented on pull request xorm/xorm#2234

WIP: Add InsertOnConflictDoNothing and Upsert functionality

Ok I've disabled the conds/exprs part for upsert - I think insert on conflict do nothing will work fine for those. Basic testing of the Upsert suggested that MySQL required a lot more work to…

1 week ago

zeripath pushed to on-conflict at zeripath/xorm

1 week ago

zeripath pushed to on-conflict at zeripath/xorm

1 week ago

zeripath pushed to on-conflict at zeripath/xorm

1 week ago

zeripath commented on pull request xorm/xorm#2234

WIP: Add InsertOnConflictDoNothing and Upsert functionality

Testcases for `map[string]interface{}` have been added. The exprs stuff is still untested and it would be good to see an example of what that should do.

1 week ago

zeripath pushed to on-conflict at zeripath/xorm

1 week ago

zeripath pushed to on-conflict at zeripath/xorm

  • 625167ded5 More cleanly handle primary keys as unique constraints

1 week ago

zeripath commented on pull request xorm/xorm#2234

WIP: Add InsertOnConflictDoNothing and Upsert functionality

So the next thing to do is to simplify the postgres and merge code to correctly handle this PK updates. Then add some tests for the `map[string]interface{}`, `[]map[string]interface{}` and…

1 week ago

zeripath pushed to on-conflict at zeripath/xorm

1 week ago

zeripath commented on pull request xorm/xorm#2234

WIP: Add InsertOnConflictDoNothing and Upsert functionality

OK so the next thing I've realised is that we can Upsert on with a table without an Unique index - so long as it has a PK autoincrement.

2 weeks ago

zeripath pushed to on-conflict at zeripath/xorm

2 weeks ago

zeripath pushed to on-conflict at zeripath/xorm

  • b4467b717a Try getting the LastInsertID before the rows affected

2 weeks ago

zeripath pushed to on-conflict at zeripath/xorm

2 weeks ago

zeripath pushed to on-conflict at zeripath/xorm

  • e88ca1d017 only permit upsert if there is only one unique constraint

2 weeks ago

zeripath commented on pull request xorm/xorm#2234

WIP: Add InsertOnConflictDoNothing and Upsert functionality

Actually thinking on I don't think you can reasonably do an upsert using these techniques if there is more than one unique constraint. So I think we should ban them.

2 weeks ago

zeripath commented on pull request xorm/xorm#2234

WIP: Add InsertOnConflictDoNothing and Upsert functionality

OK, so if there is more than one unique constraint you really need to say which one you're upserting against. For example, it's possible for two different unique constraints to fail in two…

2 weeks ago

zeripath pushed to on-conflict at zeripath/xorm

2 weeks ago

zeripath commented on pull request xorm/xorm#2234

WIP: Add InsertOnConflictDoNothing and Upsert functionality

OK I think I have basic working implementation. There are a couple of things needed: * Testcases which use the `map[string]interface{}`, `[]map[string]interface{}` and `[]bean` routes. * It…

2 weeks ago

zeripath pushed to on-conflict at zeripath/xorm

2 weeks ago

zeripath pushed to on-conflict at zeripath/xorm

2 weeks ago