Method: Libsql::SQLite3::Statement#parameter_index

Defined in:
ext/libsql/c/libsql_statement.c

#parameter_index(name) ⇒ Integer

returns the index of the named parameter from the statement. Used to help with the :VVV, @VVV and $VVV pareamter replacement styles.

Returns:

  • (Integer)


206
207
208
209
210
211
212
213
214
# File 'ext/libsql/c/libsql_statement.c', line 206

VALUE libsql_ext_sqlite3_statement_bind_parameter_index(VALUE self, VALUE parameter_name)
{
    libsql_ext_sqlite3_stmt  *libsql_ext_stmt;
    int               idx;
    
    Data_Get_Struct(self, libsql_ext_sqlite3_stmt, libsql_ext_stmt);
    idx = sqlite3_bind_parameter_index( libsql_ext_stmt->stmt, StringValuePtr( parameter_name ));
    return INT2FIX( idx );
}