xref: /netbsd-src/external/public-domain/sqlite/man/sqlite3changeset_pk.3 (revision 53b02e147d4ed531c0d2a5ca9b3e8026ba3e99b5)
1.Dd December 19, 2018
2.Dt SQLITE3CHANGESET_PK 3
3.Os
4.Sh NAME
5.Nm sqlite3changeset_pk
6.Nd Obtain The Primary Key Definition Of A Table
7.Sh SYNOPSIS
8.Ft int
9.Fo sqlite3changeset_pk
10.Fa "sqlite3_changeset_iter *pIter"
11.Fa "unsigned char **pabPK"
12.Fa "int *pnCol                      "
13.Fc
14.Sh DESCRIPTION
15For each modified table, a changeset includes the following:
16.Bl -bullet
17.It
18The number of columns in the table, and
19.It
20Which of those columns make up the tables PRIMARY KEY.
21.El
22.Pp
23This function is used to find which columns comprise the PRIMARY KEY
24of the table modified by the change that iterator pIter currently points
25to.
26If successful, *pabPK is set to point to an array of nCol entries,
27where nCol is the number of columns in the table.
28Elements of *pabPK are set to 0x01 if the corresponding column is part
29of the tables primary key, or 0x00 if it is not.
30.Pp
31If argument pnCol is not NULL, then *pnCol is set to the number of
32columns in the table.
33.Pp
34If this function is called when the iterator does not point to a valid
35entry, SQLITE_MISUSE is returned and the output variables zeroed.
36Otherwise, SQLITE_OK is returned and the output variables populated
37as described above.
38