MCPcopy Create free account
hub / github.com/bloomberg/comdb2 / luabb_carray_bind

Function luabb_carray_bind

lua/sp.c:2118–2133  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2116}
2117
2118static 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
2135static int stmt_bind_int(Lua lua, sqlite3_stmt *stmt, int name, int value)
2136{

Callers 1

stmt_bind_intFunction · 0.85

Calls 6

lua_rawgetiFunction · 0.85
luabb_carray_bind_realFunction · 0.85
luabb_carray_bind_stringFunction · 0.85
luabb_carray_bind_blobFunction · 0.85
luaL_errorFunction · 0.85

Tested by

no test coverage detected