| 2401 | |
| 2402 | static int l_send_back_row(Lua, sqlite3_stmt *, int); |
| 2403 | static int luatable_emit(Lua L) |
| 2404 | { |
| 2405 | int cols; |
| 2406 | SP sp = getsp(L); |
| 2407 | sqlite3_stmt *stmt = get_sqlrow_stmt(L); |
| 2408 | if (stmt) { |
| 2409 | cols = column_count(NULL, stmt); |
| 2410 | } else if (sp->parent->ntypes) { |
| 2411 | push_clnt_cols(L, sp); |
| 2412 | lua_pop(L, 1); |
| 2413 | cols = lua_gettop(L); |
| 2414 | } else { |
| 2415 | return luaL_error(L, "attempt to emit row without defining columns"); |
| 2416 | } |
| 2417 | /* NC: Should we iterate over all the rows here and call lua_end_step() |
| 2418 | (like dbstmt_emit()) ? */ |
| 2419 | int rc = l_send_back_row(L, stmt, cols); |
| 2420 | lua_pushinteger(L, rc); |
| 2421 | return 1; |
| 2422 | } |
| 2423 | |
| 2424 | static int dbtable_insert(Lua lua) |
| 2425 | { |
no test coverage detected