1 /* 2 * Copyright (C) 2016 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 package androidx.sqlite.db 17 18 import java.io.Closeable 19 20 /** An interface to map the behavior of [android.database.sqlite.SQLiteProgram]. */ 21 public interface SupportSQLiteProgram : Closeable { 22 /** 23 * Bind a NULL value to this statement. The value remains bound until [.clearBindings] is 24 * called. 25 * 26 * @param index The 1-based index to the parameter to bind null to 27 */ bindNullnull28 public fun bindNull(index: Int) 29 30 /** 31 * Bind a long value to this statement. The value remains bound until [clearBindings] is called. 32 * addToBindArgs 33 * 34 * @param index The 1-based index to the parameter to bind 35 * @param value The value to bind 36 */ 37 public fun bindLong(index: Int, value: Long) 38 39 /** 40 * Bind a double value to this statement. The value remains bound until [.clearBindings] is 41 * called. 42 * 43 * @param index The 1-based index to the parameter to bind 44 * @param value The value to bind 45 */ 46 public fun bindDouble(index: Int, value: Double) 47 48 /** 49 * Bind a String value to this statement. The value remains bound until [.clearBindings] is 50 * called. 51 * 52 * @param index The 1-based index to the parameter to bind 53 * @param value The value to bind, must not be null 54 */ 55 public fun bindString(index: Int, value: String) 56 57 /** 58 * Bind a byte array value to this statement. The value remains bound until [.clearBindings] is 59 * called. 60 * 61 * @param index The 1-based index to the parameter to bind 62 * @param value The value to bind, must not be null 63 */ 64 public fun bindBlob(index: Int, value: ByteArray) 65 66 /** Clears all existing bindings. Unset bindings are treated as NULL. */ 67 public fun clearBindings() 68 } 69