| 2116 | } |
| 2117 | |
| 2118 | static int luabb_carray_bind(Lua L, int lua_idx, sqlite3_stmt *stmt, int sql_idx) |
| 2119 | { |
| 2120 | lua_rawgeti(L, lua_idx, 1); |
| 2121 | dbtypes_enum dbtype = luabb_dbtype(L, -1); |
| 2122 | lua_pop(L, 1); |
| 2123 | switch (dbtype) { |
| 2124 | case DBTYPES_LNUMBER: |
| 2125 | case DBTYPES_REAL: return luabb_carray_bind_real(L, lua_idx, stmt, sql_idx); |
| 2126 | case DBTYPES_INTEGER: return luabb_carray_bind_integer(L, lua_idx, stmt, sql_idx); |
| 2127 | case DBTYPES_LSTRING: |
| 2128 | case DBTYPES_CSTRING: return luabb_carray_bind_string(L, lua_idx, stmt, sql_idx); |
| 2129 | case DBTYPES_BLOB: return luabb_carray_bind_blob(L, lua_idx, stmt, sql_idx); |
| 2130 | default: return luaL_error(L, "bad array argument to bind of type:%s", dbtypes_str[dbtype]); |
| 2131 | } |
| 2132 | return -1; |
| 2133 | } |
| 2134 | |
| 2135 | static int stmt_bind_int(Lua lua, sqlite3_stmt *stmt, int name, int value) |
| 2136 | { |
no test coverage detected