xref: /netbsd-src/external/public-domain/sqlite/man/sqlite3session_patchset.3 (revision b9988867a8ad969c45a52aa7628bc932ec98d46b)
1.Dd January 24, 2024
2.Dt SQLITE3SESSION_PATCHSET 3
3.Os
4.Sh NAME
5.Nm sqlite3session_patchset
6.Nd generate a patchset from a session object
7.Sh SYNOPSIS
8.In sqlite3.h
9.Ft int
10.Fo sqlite3session_patchset
11.Fa "sqlite3_session *pSession"
12.Fa "int *pnPatchset"
13.Fa "void **ppPatchset"
14.Fc
15.Sh DESCRIPTION
16The differences between a patchset and a changeset are that:
17.Bl -bullet
18.It
19DELETE records consist of the primary key fields only.
20The original values of other fields are omitted.
21.It
22The original values of any modified fields are omitted from UPDATE
23records.
24.El
25.Pp
26A patchset blob may be used with up to date versions of all sqlite3changeset_xxx
27API functions except for sqlite3changeset_invert(), which returns SQLITE_CORRUPT
28if it is passed a patchset.
29Similarly, attempting to use a patchset blob with old versions of the
30sqlite3changeset_xxx APIs also provokes an SQLITE_CORRUPT error.
31.Pp
32Because the non-primary key "old.*" fields are omitted, no SQLITE_CHANGESET_DATA
33conflicts can be detected or reported if a patchset is passed to the
34sqlite3changeset_apply() API.
35Other conflict types work in the same way as for changesets.
36.Pp
37Changes within a patchset are ordered in the same way as for changesets
38generated by the sqlite3session_changeset() function (i.e. all changes
39for a single table are grouped together, tables appear in the order
40in which they were attached to the session object).
41.Sh IMPLEMENTATION NOTES
42These declarations were extracted from the
43interface documentation at line 11375.
44.Bd -literal
45SQLITE_API int sqlite3session_patchset(
46  sqlite3_session *pSession,      /* Session object */
47  int *pnPatchset,                /* OUT: Size of buffer at *ppPatchset */
48  void **ppPatchset               /* OUT: Buffer containing patchset */
49);
50.Ed
51