We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents ba4ff02 + 8968474 commit db3d704Copy full SHA for db3d704
sqliter-driver/src/nativeCommonMain/kotlin/co/touchlab/sqliter/native/NativeCursor.kt
@@ -37,7 +37,18 @@ class NativeCursor(override val statement: NativeStatement) : Cursor {
37
override val columnNames: Map<String, Int> by lazy {
38
val map = HashMap<String, Int>(this.columnCount)
39
for (i in 0 until columnCount) {
40
- map.put(columnName(i), i)
+ val key = columnName(i)
41
+ if (map.containsKey(key)) {
42
+ var index = 1
43
+ val basicKey = "$key&JOIN"
44
+ var finalKey = basicKey + index
45
+ while (map.containsKey(finalKey)) {
46
+ finalKey = basicKey + ++index
47
+ }
48
+ map[finalKey] = i
49
+ } else {
50
+ map[key] = i
51
52
}
53
map
54
0 commit comments