Sqlite参考手册
C Interface: Session Module
Invert A Changeset
int sqlite3changeset_invert(
int nIn, const void *pIn, /* Input changeset */
int *pnOut, void **ppOut /* OUT: Inverse of input */
);
This function is used to "invert" a changeset object. Applying an inverted changeset to a database reverses the effects of applying the uninverted changeset. Specifically:
- Each DELETE change is changed to an INSERT, and
- Each INSERT change is changed to a DELETE, and
- For each UPDATE change, the old.* and new.* values are exchanged.
This function does not change the order in which changes appear within the changeset. It merely reverses the sense of each individual change.
If successful, a pointer to a buffer containing the inverted changeset is stored in *ppOut, the size of the same buffer is stored in *pnOut, and SQLITE_OK is returned. If an error occurs, both *pnOut and *ppOut are zeroed and an SQLite error code returned.
It is the responsibility of the caller to eventually call sqlite3_free() on the *ppOut pointer to free the buffer allocation following a successful call to this function.
WARNING/TODO: This function currently assumes that the input is a valid changeset. If it is not, the results are undefined.
See also lists of Objects, Constants, and Functions.
SQLite is in the Public Domain.
https://sqlite.org/session/sqlite3changeset_invert.html
C Interface: Session Module相关
SQLite,是一款轻型的数据库,是遵守ACID的关系型数据库管理系统,它包含在一个相对小的C库中。它是D.RichardHipp建立的公有领域项目。它的设计目标是嵌入式的,而且目前已经在很多嵌入式产品中使用了它,它占用资源非常的低,在嵌入式设备中,可能只需要几百K的内存就够了。它能够支持Windows/Linux/Unix等等主流的操作系统,同时能够跟很多程序语言相结合,比如 Tcl、C#、PHP、Java等,还有ODBC接口,同样比起Mysql、PostgreSQL这两款开源的世界著名数据库管理系统来
主页 | https://sqlite.org/ |
源码 | https://www.sqlite.org/src/ |
发布版本 | 3.21.0 |