xref: /netbsd-src/external/public-domain/sqlite/man/sqlite3changeset_start.3 (revision 022f005200bc25af02826a05c8d86d0ef18232dc)
1.Dd March 11, 2017
2.Dt SQLITE3CHANGESET_START 3
3.Os
4.Sh NAME
5.Nm sqlite3changeset_start
6.Nd Create An Iterator To Traverse A Changeset
7.Sh SYNOPSIS
8.Ft int
9.Fo sqlite3changeset_start
10.Fa "sqlite3_changeset_iter **pp"
11.Fa "int nChangeset"
12.Fa "void *pChangeset                "
13.Fc
14.Sh DESCRIPTION
15Create an iterator used to iterate through the contents of a changeset.
16If successful, *pp is set to point to the iterator handle and SQLITE_OK
17is returned.
18Otherwise, if an error occurs, *pp is set to zero and an SQLite error
19code is returned.
20.Pp
21The following functions can be used to advance and query a changeset
22iterator created by this function:
23.Bl -bullet
24.It
25sqlite3changeset_next()
26.It
27sqlite3changeset_op()
28.It
29sqlite3changeset_new()
30.It
31sqlite3changeset_old()
32.El
33.Pp
34It is the responsibility of the caller to eventually destroy the iterator
35by passing it to sqlite3changeset_finalize().
36The buffer containing the changeset (pChangeset) must remain valid
37until after the iterator is destroyed.
38.Pp
39Assuming the changeset blob was created by one of the sqlite3session_changeset(),
40sqlite3changeset_concat() or sqlite3changeset_invert()
41functions, all changes within the changeset that apply to a single
42table are grouped together.
43This means that when an application iterates through a changeset using
44an iterator created by this function, all changes that relate to a
45single table are visited consecutively.
46There is no chance that the iterator will visit a change the applies
47to table X, then one for table Y, and then later on visit another change
48for table X.
49.Sh SEE ALSO
50.Xr sqlite3changeset_concat 3 ,
51.Xr sqlite3changeset_finalize 3 ,
52.Xr sqlite3changeset_invert 3 ,
53.Xr sqlite3changeset_new 3 ,
54.Xr sqlite3changeset_next 3 ,
55.Xr sqlite3changeset_old 3 ,
56.Xr sqlite3changeset_op 3 ,
57.Xr sqlite3session_changeset 3
58