xref: /netbsd-src/external/public-domain/sqlite/man/sqlite3changegroup_schema.3 (revision b9988867a8ad969c45a52aa7628bc932ec98d46b)
1.Dd January 24, 2024
2.Dt SQLITE3CHANGEGROUP_SCHEMA 3
3.Os
4.Sh NAME
5.Nm sqlite3changegroup_schema
6.Nd add a schema to a changegroup
7.Sh SYNOPSIS
8.In sqlite3.h
9.Ft int
10.Fo sqlite3changegroup_schema
11.Fa "sqlite3_changegroup*"
12.Fa "sqlite3*"
13.Fa "const char *zDb"
14.Fc
15.Sh DESCRIPTION
16This method may be used to optionally enforce the rule that the changesets
17added to the changegroup handle must match the schema of database zDb
18("main", "temp", or the name of an attached database).
19If sqlite3changegroup_add() is called to add a changeset that is not
20compatible with the configured schema, SQLITE_SCHEMA is returned and
21the changegroup object is left in an undefined state.
22.Pp
23A changeset schema is considered compatible with the database schema
24in the same way as for sqlite3changeset_apply().
25Specifically, for each table in the changeset, there exists a database
26table with:
27.Bl -bullet
28.It
29The name identified by the changeset, and
30.It
31at least as many columns as recorded in the changeset, and
32.It
33the primary key columns in the same position as recorded in the changeset.
34.El
35.Pp
36The output of the changegroup object always has the same schema as
37the database nominated using this function.
38In cases where changesets passed to sqlite3changegroup_add() have fewer
39columns than the corresponding table in the database schema, these
40are filled in using the default column values from the database schema.
41This makes it possible to combined changesets that have different numbers
42of columns for a single table within a changegroup, provided that they
43are otherwise compatible.
44.Sh IMPLEMENTATION NOTES
45These declarations were extracted from the
46interface documentation at line 11868.
47.Bd -literal
48SQLITE_API int sqlite3changegroup_schema(sqlite3_changegroup*, sqlite3*, const char *zDb);
49.Ed
50