xref: /netbsd-src/external/public-domain/sqlite/man/sqlite3changegroup_new.3 (revision b9988867a8ad969c45a52aa7628bc932ec98d46b)
1.Dd January 24, 2024
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.In sqlite3.h
9.Ft int
10.Fo sqlite3changegroup_new
11.Fa "sqlite3_changegroup **pp"
12.Fc
13.Sh DESCRIPTION
14An sqlite3_changegroup object is used to combine two or more changesets
15(or patchsets) into a single changeset (or patchset).
16A single changegroup object may combine changesets or patchsets, but
17not both.
18The output is always in the same format as the input.
19.Pp
20If successful, this function returns SQLITE_OK and populates (*pp)
21with a pointer to a new sqlite3_changegroup object before returning.
22The caller should eventually free the returned object using a call
23to sqlite3changegroup_delete().
24If an error occurs, an SQLite error code (i.e. SQLITE_NOMEM) is returned
25and *pp is set to NULL.
26.Pp
27The usual usage pattern for an sqlite3_changegroup object is as follows:
28.Bl -bullet
29.It
30It is created using a call to sqlite3changegroup_new().
31.It
32Zero or more changesets (or patchsets) are added to the object by calling
33sqlite3changegroup_add().
34.It
35The result of combining all input changesets together is obtained by
36the application via a call to sqlite3changegroup_output().
37.It
38The object is deleted using a call to sqlite3changegroup_delete().
39.El
40.Pp
41Any number of calls to add() and output() may be made between the calls
42to new() and delete(), and in any order.
43.Pp
44As well as the regular sqlite3changegroup_add() and sqlite3changegroup_output()
45functions, also available are the streaming versions sqlite3changegroup_add_strm()
46and sqlite3changegroup_output_strm().
47.Sh IMPLEMENTATION NOTES
48These declarations were extracted from the
49interface documentation at line 11830.
50.Bd -literal
51SQLITE_API int sqlite3changegroup_new(sqlite3_changegroup **pp);
52.Ed
53