xref: /netbsd-src/external/public-domain/sqlite/man/sqlite3changegroup_new.3 (revision 82d56013d7b633d116a93943de88e08335357a7c)
1.Dd December 19, 2018
2.Dt SQLITE3CHANGEGROUP_NEW 3
3.Os
4.Sh NAME
5.Nm sqlite3changegroup_new
6.Nd Create A New Changegroup Object
7.Sh SYNOPSIS
8.Ft int
9.Fo sqlite3changegroup_new
10.Fa "sqlite3_changegroup **pp"
11.Fc
12.Sh DESCRIPTION
13An sqlite3_changegroup object is used to combine two or more changesets
14(or patchsets) into a single changeset (or patchset).
15A single changegroup object may combine changesets or patchsets, but
16not both.
17The output is always in the same format as the input.
18.Pp
19If successful, this function returns SQLITE_OK and populates (*pp)
20with a pointer to a new sqlite3_changegroup object before returning.
21The caller should eventually free the returned object using a call
22to sqlite3changegroup_delete().
23If an error occurs, an SQLite error code (i.e.
24SQLITE_NOMEM) is returned and *pp is set to NULL.
25.Pp
26The usual usage pattern for an sqlite3_changegroup object is as follows:
27.Bl -bullet
28.It
29It is created using a call to sqlite3changegroup_new().
30.It
31Zero or more changesets (or patchsets) are added to the object by calling
32sqlite3changegroup_add().
33.It
34The result of combining all input changesets together is obtained by
35the application via a call to sqlite3changegroup_output().
36.It
37The object is deleted using a call to sqlite3changegroup_delete().
38.El
39.Pp
40Any number of calls to add() and output() may be made between the calls
41to new() and delete(), and in any order.
42.Pp
43As well as the regular sqlite3changegroup_add() and sqlite3changegroup_output()
44functions, also available are the streaming versions sqlite3changegroup_add_strm()
45and sqlite3changegroup_output_strm().
46