mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-08-08 19:00:27 +00:00
Add session diff method to SQLite Lua API
This commit is contained in:
parent
781976b199
commit
8b1d6a37c2
1 changed files with 11 additions and 0 deletions
|
@ -2205,6 +2205,16 @@ static int lsession_isempty(lua_State *L) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int lsession_diff(lua_State *L) {
|
||||||
|
lsession *lses = lsqlite_checksession(L, 1);
|
||||||
|
const char *zFromDb = luaL_checkstring(L, 2);
|
||||||
|
const char *zTbl = luaL_checkstring(L, 3);
|
||||||
|
int rc = sqlite3session_diff(lses->ses, zFromDb, zTbl, NULL);
|
||||||
|
if (rc != SQLITE_OK) return pusherr(L, rc);
|
||||||
|
lua_pushboolean(L, 1);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
static int lsession_bool(
|
static int lsession_bool(
|
||||||
lua_State *L,
|
lua_State *L,
|
||||||
int (*session_func)(sqlite3_session *ses, int val)
|
int (*session_func)(sqlite3_session *ses, int val)
|
||||||
|
@ -2696,6 +2706,7 @@ static const luaL_Reg seslib[] = {
|
||||||
{"isempty", lsession_isempty },
|
{"isempty", lsession_isempty },
|
||||||
{"indirect", lsession_indirect },
|
{"indirect", lsession_indirect },
|
||||||
{"enable", lsession_enable },
|
{"enable", lsession_enable },
|
||||||
|
{"diff", lsession_diff },
|
||||||
{"delete", lsession_delete },
|
{"delete", lsession_delete },
|
||||||
|
|
||||||
{"__tostring", lsession_tostring },
|
{"__tostring", lsession_tostring },
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue