Skip to content

Commit b691766

Browse files
committed
Implemented "MappingSupportSQLiteQuery.bindTo" with "OneOffDelegate"
*This commit is related to issue #529 [1]* [1] #529
1 parent 9f70454 commit b691766

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

data/src/main/java/org/cryptomator/data/db/sqlmapping/MappingSupportSQLiteDatabase.kt

+6
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import android.os.CancellationSignal
77
import androidx.sqlite.db.SimpleSQLiteQuery
88
import androidx.sqlite.db.SupportSQLiteDatabase
99
import androidx.sqlite.db.SupportSQLiteOpenHelper
10+
import androidx.sqlite.db.SupportSQLiteProgram
1011
import androidx.sqlite.db.SupportSQLiteQuery
1112
import androidx.sqlite.db.SupportSQLiteStatement
1213
import timber.log.Timber
@@ -166,9 +167,14 @@ internal class MappingSupportSQLiteDatabase(
166167

167168
private val _sql = map(delegateQuery.sql)
168169
private val sqlDelegate = OneOffDelegate { Timber.tag("MappingSupportSQLiteQuery").e("SQL queried twice") }
170+
private val bindToDelegate = OneOffDelegate { Timber.tag("MappingSupportSQLiteQuery").e("bindTo called twice") }
169171

170172
override val sql: String
171173
get() = sqlDelegate.call { _sql }
174+
175+
override fun bindTo(statement: SupportSQLiteProgram) {
176+
bindToDelegate.call { delegateQuery.bindTo(statement) }
177+
}
172178
}
173179
}
174180

0 commit comments

Comments
 (0)