Closed tecc closed 1 year ago
As a side effect, the order of fields that the user specifies in the insert/update statements should now be irrelevant. Yay for usability!
Thanks, could you also add some kind of test-case scenario, so we can track changes related to this part of impl? :)
I guess this is related to #6
It most likely is related, at a guess.
I added a test case for it (although I'm unsure if it's correct or not), which makes all records in statisticsRepository have a count equal to one and have any xyz
in their URI substituted with abc
.
Looks like the test failed on CI for SQLiteUpsertTest
🤔
java.lang.ArrayIndexOutOfBoundsException: Index 4 out of bounds for length 4
I debugged the code I wrote and I realised the problem: update statements cannot update any key in indexColumns, which caused a problem when I tried to update uri
.
Thanks! Sorry for late response, I'm slightly busy lately 😅 I'll release 1.2.0, so it should be available within an hour on Maven Central :)
There's a very specific bug with this library - the
DO UPDATE SET
part of the generated query has the fields ordered as the user specified them, whereas the replacement is set based on the key (i.e. they're alphabetically ordered). This PR just fixes that bug, plus makes that subset of the code slightly more maintainable.I am not entirely sure if this has introduced another bug or not, but it seems to work so it's probably fine.