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

Function luabb_carray_bind_string

lua/sp.c:2088–2098  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2086}
2087
2088static int luabb_carray_bind_string(Lua L, int lua_idx, sqlite3_stmt *stmt, int sql_idx)
2089{
2090 int count = lua_objlen(L, lua_idx);
2091 const char *strings[count];
2092 for (int i = 1; i <= count; ++i) {
2093 lua_rawgeti(L, lua_idx, i);
2094 strings[i - 1] = luabb_tostring(L, -1);
2095 lua_pop(L, 1);
2096 }
2097 return sqlite3_carray_bind(stmt, sql_idx, strings, count, CARRAY_TEXT, SQLITE_TRANSIENT);
2098}
2099
2100static int luabb_carray_bind_blob(Lua L, int lua_idx, sqlite3_stmt *stmt, int sql_idx)
2101{

Callers 1

luabb_carray_bindFunction · 0.85

Calls 4

lua_objlenFunction · 0.85
lua_rawgetiFunction · 0.85
luabb_tostringFunction · 0.85
sqlite3_carray_bindFunction · 0.85

Tested by

no test coverage detected