<commit_before>package com.gazman.db

import android.content.ContentValues
import android.database.Cursor
import android.database.SQLException
import android.database.sqlite.SQLiteTransactionListener
import android.os.Build
import android.os.CancellationSignal
import android.util.Pair
import androidx.annotation.RequiresApi
import androidx.sqlite.db.SupportSQLiteDatabase
import androidx.sqlite.db.SupportSQLiteQuery
import io.requery.android.database.sqlite.SQLiteDatabase
import io.requery.android.database.sqlite.SQLiteStatement
import java.io.IOException
import java.util.*

class DbProxy(private val db: SQLiteDatabase) : SupportSQLiteDatabase {
    override fun compileStatement(sql: String): SQLiteStatement {
        return db.compileStatement(sql)
    }

    override fun beginTransaction() {
        db.beginTransaction()
    }

    override fun beginTransactionNonExclusive() {
        db.beginTransactionNonExclusive()
    }

    override fun beginTransactionWithListener(transactionListener: SQLiteTransactionListener) {
        db.beginTransactionWithListener(transactionListener)
    }

    override fun beginTransactionWithListenerNonExclusive(transactionListener: SQLiteTransactionListener) {
        db.beginTransactionWithListenerNonExclusive(transactionListener)
    }

    override fun endTransaction() {
        db.endTransaction()
    }

    override fun setTransactionSuccessful() {
        db.setTransactionSuccessful()
    }

    override fun inTransaction(): Boolean {
        return db.inTransaction()
    }

    override fun isDbLockedByCurrentThread(): Boolean {
        return db.isDbLockedByCurrentThread
    }

    override fun yieldIfContendedSafely(): Boolean {
        return db.yieldIfContendedSafely()
    }

    override fun yieldIfContendedSafely(sleepAfterYieldDelay: Long): Boolean {
        return db.yieldIfContendedSafely(sleepAfterYieldDelay)
    }

    override fun getVersion(): Int {
        return db.version
    }

    override fun setVersion(version: Int) {
        db.version = version
    }

    override fun getMaximumSize(): Long {
        return db.maximumSize
    }

    override fun setMaximumSize(numBytes: Long): Long {
        return db.setMaximumSize(numBytes)
    }

    override fun getPageSize(): Long {
        return db.pageSize
    }

    override fun setPageSize(numBytes: Long) {
        db.pageSize = numBytes
    }

    override fun query(query: String): Cursor {
        log(query)
        return db.query(query)
    }

    override fun query(query: String, bindArgs: Array<Any>): Cursor {
        log(query)
        return db.query(query, bindArgs)
    }

    override fun query(query: SupportSQLiteQuery): Cursor {
        return db.query(query)
    }

    @RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN)
    override fun query(query: SupportSQLiteQuery, cancellationSignal: CancellationSignal): Cursor {
        return db.query(query, cancellationSignal)
    }

    @Throws(SQLException::class)
    override fun insert(table: String, conflictAlgorithm: Int, values: ContentValues): Long {
        return db.insert(table, conflictAlgorithm, values)
    }

    fun insert(table: String?, nullColumnHack: String?, values: ContentValues?): Long {
        return db.insert(table, nullColumnHack, values)
    }

    fun delete(table: String) = db.delete(table, null, null)
    fun delete(table: String, whereClause: String?) = db.delete(table, whereClause, null)

    override fun delete(table: String, whereClause: String?, whereArgs: Array<Any>?): Int {
        return db.delete(table, whereClause, whereArgs)
    }

    override fun update(
        table: String,
        conflictAlgorithm: Int,
        values: ContentValues,
        whereClause: String,
        whereArgs: Array<Any>
    ): Int {
        return db.update(table, conflictAlgorithm, values, whereClause, whereArgs)
    }

    fun update(<commit_msg>Fixed merging and new contact screen<commit_after>package com.gazman.db

import android.content.ContentValues
import android.database.Cursor
import android.database.SQLException
import android.database.sqlite.SQLiteTransactionListener
import android.os.Build
import android.os.CancellationSignal
import android.util.Pair
import androidx.annotation.RequiresApi
import androidx.sqlite.db.SupportSQLiteDatabase
import androidx.sqlite.db.SupportSQLiteQuery
import io.requery.android.database.sqlite.SQLiteDatabase
import io.requery.android.database.sqlite.SQLiteStatement
import java.io.IOException
import java.util.*

class DbProxy(private val db: SQLiteDatabase) : SupportSQLiteDatabase {
    override fun compileStatement(sql: String): SQLiteStatement {
        return db.compileStatement(sql)
    }

    override fun beginTransaction() {
        db.beginTransaction()
    }

    override fun beginTransactionNonExclusive() {
        db.beginTransactionNonExclusive()
    }

    override fun beginTransactionWithListener(transactionListener: SQLiteTransactionListener) {
        db.beginTransactionWithListener(transactionListener)
    }

    override fun beginTransactionWithListenerNonExclusive(transactionListener: SQLiteTransactionListener) {
        db.beginTransactionWithListenerNonExclusive(transactionListener)
    }

    override fun endTransaction() {
        db.endTransaction()
    }

    override fun setTransactionSuccessful() {
        db.setTransactionSuccessful()
    }

    override fun inTransaction(): Boolean {
        return db.inTransaction()
    }

    override fun isDbLockedByCurrentThread(): Boolean {
        return db.isDbLockedByCurrentThread
    }

    override fun yieldIfContendedSafely(): Boolean {
        return db.yieldIfContendedSafely()
    }

    override fun yieldIfContendedSafely(sleepAfterYieldDelay: Long): Boolean {
        return db.yieldIfContendedSafely(sleepAfterYieldDelay)
    }

    override fun getVersion(): Int {
        return db.version
    }

    override fun setVersion(version: Int) {
        db.version = version
    }

    override fun getMaximumSize(): Long {
        return db.maximumSize
    }

    override fun setMaximumSize(numBytes: Long): Long {
        return db.setMaximumSize(numBytes)
    }

    override fun getPageSize(): Long {
        return db.pageSize
    }

    override fun setPageSize(numBytes: Long) {
        db.pageSize = numBytes
    }

    override fun query(query: String): Cursor {
        log(query)
        return db.query(query)
    }

    override fun query(query: String, bindArgs: Array<Any>): Cursor {
        log(query)
        return db.query(query, bindArgs)
    }

    override fun query(query: SupportSQLiteQuery): Cursor {
        return db.query(query)
    }

    @RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN)
    override fun query(query: SupportSQLiteQuery, cancellationSignal: CancellationSignal): Cursor {
        return db.query(query, cancellationSignal)
    }

    @Throws(SQLException::class)
    override fun insert(table: String, conflictAlgorithm: Int, values: ContentValues): Long {
        return db.insert(table, conflictAlgorithm, values)
    }

    fun insert(table: String?, nullColumnHack: String?, values: ContentValues?): Long {
        return db.insert(table, nullColumnHack, values)
    }

    fun delete(table: String) = db.delete(table, null, null)
    fun delete(table: String, whereClause: String?) = db.delete(table, whereClause, null)

    override fun delete(table: String, whereClause: String?, whereArgs: Array<Any>?): Int {
        log("delete from $table where $whereClause ${whereArgs?.joinToString()}")
        return db.delete(table, whereClause, whereArgs)
    }

    override fun update(
        table: String,
        conflictAlgorithm: Int,
        values: ContentValues,
        whereClause: String,
        whereArgs: Array<Any>
    ): Int {
        return db.update(table, conflictAlgorithm, values, whereClause, whereArgs)
    }

    fun update(
{'fraction_non_alphanumeric': 0.0850120359812492, 'fraction_numerical': 0.0, 'mean_word_length': 3.447323943661972, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4137770', 'n_tokens_mistral': 2175, 'n_tokens_neox': 2128, 'n_words': 498}