summaryrefslogtreecommitdiff
path: root/static/netbsd/man3/sqlite3changeset_start.3
blob: f738b1bc4e55c8ed128c284636e85612569a6c5e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
.Dd January 24, 2024
.Dt SQLITE3CHANGESET_START 3
.Os
.Sh NAME
.Nm sqlite3changeset_start ,
.Nm sqlite3changeset_start_v2
.Nd create an iterator to traverse a changeset
.Sh SYNOPSIS
.In sqlite3.h
.Ft int
.Fo sqlite3changeset_start
.Fa "sqlite3_changeset_iter **pp"
.Fa "int nChangeset"
.Fa "void *pChangeset"
.Fc
.Ft int
.Fo sqlite3changeset_start_v2
.Fa "sqlite3_changeset_iter **pp"
.Fa "int nChangeset"
.Fa "void *pChangeset"
.Fa "int flags"
.Fc
.Sh DESCRIPTION
Create an iterator used to iterate through the contents of a changeset.
If successful, *pp is set to point to the iterator handle and SQLITE_OK
is returned.
Otherwise, if an error occurs, *pp is set to zero and an SQLite error
code is returned.
.Pp
The following functions can be used to advance and query a changeset
iterator created by this function:
.Bl -bullet
.It
.Fn sqlite3changeset_next
.It
.Fn sqlite3changeset_op
.It
.Fn sqlite3changeset_new
.It
.Fn sqlite3changeset_old
.El
.Pp
It is the responsibility of the caller to eventually destroy the iterator
by passing it to
.Fn sqlite3changeset_finalize .
The buffer containing the changeset (pChangeset) must remain valid
until after the iterator is destroyed.
.Pp
Assuming the changeset blob was created by one of the
.Fn sqlite3session_changeset ,
.Fn sqlite3changeset_concat
or
.Fn sqlite3changeset_invert
functions, all changes within the changeset that apply to a single
table are grouped together.
This means that when an application iterates through a changeset using
an iterator created by this function, all changes that relate to a
single table are visited consecutively.
There is no chance that the iterator will visit a change the applies
to table X, then one for table Y, and then later on visit another change
for table X.
.Pp
The behavior of sqlite3changeset_start_v2() and its streaming equivalent
may be modified by passing a combination of supported flags
as the 4th parameter.
.Pp
Note that the sqlite3changeset_start_v2() API is still \fBexperimental\fP
and therefore subject to change.
.Sh IMPLEMENTATION NOTES
These declarations were extracted from the
interface documentation at line 11435.
.Bd -literal
SQLITE_API int sqlite3changeset_start(
  sqlite3_changeset_iter **pp,    /* OUT: New changeset iterator handle */
  int nChangeset,                 /* Size of changeset blob in bytes */
  void *pChangeset                /* Pointer to blob containing changeset */
);
SQLITE_API int sqlite3changeset_start_v2(
  sqlite3_changeset_iter **pp,    /* OUT: New changeset iterator handle */
  int nChangeset,                 /* Size of changeset blob in bytes */
  void *pChangeset,               /* Pointer to blob containing changeset */
  int flags                       /* SESSION_CHANGESETSTART_* flags */
);
.Ed
.Sh SEE ALSO
.Xr sqlite3changeset_concat 3 ,
.Xr sqlite3changeset_finalize 3 ,
.Xr sqlite3changeset_invert 3 ,
.Xr sqlite3changeset_new 3 ,
.Xr sqlite3changeset_next 3 ,
.Xr sqlite3changeset_old 3 ,
.Xr sqlite3changeset_op 3 ,
.Xr sqlite3session_changeset 3 ,
.Xr SQLITE_CHANGESETSTART_INVERT 3