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

Function luabb_carray_bind_integer

lua/sp.c:2076–2086  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2074}
2075
2076static int luabb_carray_bind_integer(Lua L, int lua_idx, sqlite3_stmt *stmt, int sql_idx)
2077{
2078 int count = lua_objlen(L, lua_idx);
2079 long long ints[count];
2080 for (int i = 1; i <= count; ++i) {
2081 lua_rawgeti(L, lua_idx, i);
2082 luabb_tointeger(L, -1, &ints[i - 1]);
2083 lua_pop(L, 1);
2084 }
2085 return sqlite3_carray_bind(stmt, sql_idx, ints, count, CARRAY_INT64, SQLITE_TRANSIENT);
2086}
2087
2088static int luabb_carray_bind_string(Lua L, int lua_idx, sqlite3_stmt *stmt, int sql_idx)
2089{

Callers 1

luabb_carray_bindFunction · 0.85

Calls 4

lua_objlenFunction · 0.85
lua_rawgetiFunction · 0.85
luabb_tointegerFunction · 0.85
sqlite3_carray_bindFunction · 0.85

Tested by

no test coverage detected